Implementation of simple sparse autoencoder