working autoencoder and more compact numerical gradient check