adapt to the head version of the SGD libary