added max epoch termination criteria to sgd on mnist example