created a SparseAutoEncoder class and added in the cost function