Variance Reduction for Stochastic Gradient Optimization