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

Minor code refinement #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Minor code refinement #14

wants to merge 3 commits into from

Conversation

yihe-61wu
Copy link

I really appreciate this project, offering a light-weighted python implementation of RBM. While I have to change the code a lot for my own purpose, I refine rbm.py a little bit:

  1. The code duplication between run_hidden and run_visible has been removed. A similar approach to yang-zhang's pull request is used. (I wasn't aware of his code until I decided to make this pull request myself.) But I keep run_hidden and run_visible for compatibility.
  2. The logistic function has been modified. As the project is dependent on numpy, which gives overflow error for numpy.exp(x) when x is larger than 709 (for float64 if I remember correctly).
  3. I'm sorry that I also changed entirely the indent for my own purpose, and it also makes the code comparison harder on GitHub. But as the topic suggests I merely made some minor refinement stated in the above two points.

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

Successfully merging this pull request may close these issues.

1 participant