Implements stochastic gradiant optimization of parameter