DeepLearning
DeepLearning copied to clipboard
Quension about the updation of weight matrix.
Recently, I am learning your RBM python code. All codes are OK except the updating formula of parameters used in your contrastive_divergence function. I found that the bias vectors are updated using the mean gradient of a batch training examples, while the weight matrix is not such the case. Hence, can kindly you give some explanation about the equation (Line 61-62) in details. I am looking forward your early replay.
I think maybe the following equation is right: self.W += lr * sum([ np.dot(self.input[i,:].T, ph_mean[i,:]) - np.dot(self.nv_samples[i,:].T, nh_mean[i,:]) for i in range(self.input.shape[0]) ]) / self.input.shape[0]