Fix bug in backprop; add MLPBaseTrainer class (cf. #128)