Skip to content
Discussion options

You must be logged in to vote

You can probably overcome issues with memory by using TSNPE:

from sbi.inference import NPE
from sbi.utils import RestrictedPrior, get_density_thresholder

inference = NPE(prior)
proposal = prior
for _ in range(num_rounds):
    theta = proposal.sample((num_sims,))
    x = simulator(theta)
    _ = inference.append_simulations(theta, x).train(force_first_round_loss=True)
    posterior = inference.build_posterior().set_default_x(x_o)

    accept_reject_fn = get_density_thresholder(posterior, quantile=1e-4)
    proposal = RestrictedPrior(prior, accept_reject_fn, sample_with="rejection")

Aside, TSNPE is typically much more stable and robust than other SNPE methods, and it is also the only SNPE …

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@Millet21
Comment options

@michaeldeistler
Comment options

Answer selected by Millet21
@Millet21
Comment options

@Millet21
Comment options

@michaeldeistler
Comment options

@Millet21
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Millet21
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants