implemented early stopping and momentum for multinomial classifier