Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quension about the updation of weight matrix. #22

Open
xiaohu2015 opened this issue Jul 20, 2016 · 1 comment
Open

Quension about the updation of weight matrix. #22

xiaohu2015 opened this issue Jul 20, 2016 · 1 comment

Comments

@xiaohu2015
Copy link

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.

@xiaohu2015
Copy link
Author

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant