Stochastic Gradient Optimization

Implements Stochastic Gradient Descent function optimization.