Factoring out backprop2 from autoencoder