First version of Sparse Autoencoder cost & gradient functions