Derivatives of Stochastic Gradient Descent in parametric optimization