Trainning a digit classifier with affine invariant stochastic optimization