An efficient constrained learning algorithm with momentum acceleration