I am trying to implement sparse autoencoders according to Andrew Ng\'s lecture notes as shown here. It requires that a sparsity constraint be applied on an autoencoder layer by
You have defined self.p = -0.9 instead of the 0.05 value that both the original poster and the lecture notes you referred to are using.