sgd with momentum in batch mode