Implemented first part of Backpropagation for autoencoder