In built method to sample params with a constraint? #1547
Answered
by
michaeldeistler
5183nischal
asked this question in
Q&A
-
Is there a way that I can sample parameters with Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
michaeldeistler
Mar 28, 2025
Replies: 1 comment 1 reply
-
You can probably achieve that with the from sbi.utils import RestrictedPrior
prior = BoxUniform(-torch.ones((3,)), torch.ones((3,)))
def accept_reject_fn(params):
return True is torch.sum(params) > 1.5 else False
restricted_prior = RestrictedPrior(prior, accept_reject_fn) Let me know if this works! |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
janfb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can probably achieve that with the
RestrictedPrior
.Let me know if this works!
Michael