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

what sampling method does approximate inference class use? #1726

Open
hjyoon93 opened this issue Feb 17, 2024 · 1 comment
Open

what sampling method does approximate inference class use? #1726

hjyoon93 opened this issue Feb 17, 2024 · 1 comment

Comments

@hjyoon93
Copy link

Inside approximate inference using sampling class,

there is this "query" function as below.

query(variables, n_samples=10000, samples=None, evidence=None, virtual_evidence=None, joint=True, state_names=None, show_progress=True, seed=None)

If I sample using "n_samples=100", what sampling method does it use to sample 100 samples?

Is it forward sampling, rejection sampling or likelihood weighted sampling?

And If I use query method to do sampling, does it sample based on evidence I give?

@ankurankan
Copy link
Member

@hjyoon93 When no evidence is provided, it does a forward sampling. When evidence is provided, it does a rejection sampling till the specified number of samples are generated that satisfy the given evidence.

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

2 participants