Fix batch update calculation.

Store training parameters, update mnist rbm.