added in ipython notebook for stochastic gradient descent