Applying deep learning and a RBM to MNIST using Python