This is my solution of the stanford CS294 programming exercise. It is a general implementation of the Sparse Autoencoder. More information please see: http://ufldl.stanford.edu/
This implementation can be easily modified to other kinds of autoencoder. For example, I once try to modified it to the recursive antoencoder for NLP. The things you need to change are the recursive form, cost function and the gradient of the cost function.