An implementation of sparse autoencoder for automatic learning