Added option to perform mini batch gradient descent