autoencoder is hard to implement right