Skip to content

Fix: added pseudo-likelihood normalization option in RBM #23179 #31099

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

henriquessss
Copy link

Reference Issues/PRs

Fixes #23179

What does this implement/fix? Explain your changes.

This PR introduces an optional normalize parameter to the score_samples method of the RBM class.

Currently, score_samples returns the pseudo-likelihood multiplied by the number of visible units (n_features), which causes the output to scale with input dimensionality. This can make it harder to compare models across datasets or inputs with different numbers of features.

When normalize=True, the method instead returns a per-feature pseudo-likelihood value.

The default behavior remains unchanged (normalize=False), ensuring backward compatibility.

Any other comments?

I believe this addition is appropriate given the scaling behavior of the current pseudo-likelihood implementation and I’m open to alternative suggestions or feedback on a better way to handle this!

Copy link

github-actions bot commented Mar 28, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: d7b1bb6. Link to the linter CI: here

@henriquessss henriquessss force-pushed the fix-rbm-pseudolikelihood-normalization branch from c7556a4 to 8ed52bd Compare March 28, 2025 14:21
@henriquessss henriquessss force-pushed the fix-rbm-pseudolikelihood-normalization branch from 8ed52bd to 0c63de2 Compare March 28, 2025 15:40
@adrinjalali
Copy link
Member

@antoinebaker this could use your review please 😊

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

Successfully merging this pull request may close these issues.

Wrong normalization for pseudolikelihood in Restricted Boltzmann Machine.
2 participants