fixed a bunch of bugs in the autoencoder - MNIST_demo, STL_demo and SAE_demo now all work, and gradient checking has been cleaned up and also verified to work