Adapt to new sgd library