Skip to content

Is it possible to continue training on top of an already saved posterior? #869

Answered by michaeldeistler
apongos asked this question in Q&A
Discussion options

You must be logged in to vote

Please use the flexible interface for that.

from sbi.inference import SNPE, prepare_for_sbi, simulate_for_sbi

simulator, prior = prepare_for_sbi(simulator, prior)
inference = SNPE(prior)

theta, x = simulate_for_sbi(simulator, proposal=prior, num_simulations=1000)
# ==== This is where you want to save the simulations (e.g. with pickle) and load them next time

density_estimator = inference.append_simulations(theta, x).train()
posterior = inference.build_posterior(density_estimator)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by janfb
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