Generic Stochastic Gradient Methods