-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: batched sampling for vectorized MCMC (#1176)
* Base estimator class * intermediate commit * make autoreload work * `amortized_sample` works for MCMCPosterior * fixes current bug! * Added tests * batched_rejection_sampling * intermediate commit * make autoreload work * `amortized_sample` works for MCMCPosterior * Revert "Merge branch '990-add-sample_batched-and-log_prob_batched-to-posteriors' into amortizedsample" This reverts commit 07084e2, reversing changes made to f16622d. * sample works, try log_prob_batched * log_prob_batched works * abstract method implement for other methods * temp fix mcmcposterior * meh for general use i.e. in the restriction prior we have to add some reshapes in rejection * ... test class * Revert "Base estimator class" This reverts commit 17c5343. * removing previous change * removing some artifacts * revert wierd change * docs and tests * MCMC sample_batched works but not log_prob batched * adding some docs * batch_log_prob for MCMC requires at best changes for potential -> removed * intermediate commit * make autoreload work * `amortized_sample` works for MCMCPosterior * intermediate commit * make autoreload work * `amortized_sample` works for MCMCPosterior * Base estimator class * Revert "Merge branch '990-add-sample_batched-and-log_prob_batched-to-posteriors' into amortizedsample" This reverts commit 07084e2, reversing changes made to f16622d. * fixes current bug! * Added tests * batched_rejection_sampling * sample works, try log_prob_batched * log_prob_batched works * abstract method implement for other methods * temp fix mcmcposterior * meh for general use i.e. in the restriction prior we have to add some reshapes in rejection * ... test class * Revert "Base estimator class" This reverts commit 17c5343. * removing previous change * removing some artifacts * revert wierd change * docs and tests * MCMC sample_batched works but not log_prob batched * adding some docs * batch_log_prob for MCMC requires at best changes for potential -> removed * Fixing bug from rebase... * tracking all acceptance rates * Comment on NFlows * Also testing SNRE batched sampling, Need to test ensemble implementation * fig bug * Ensemble sample_batched is working (with tests) * GPU compatibility * restriction priopr requires float as output of accept_reject * Adding a few comments * 2d sample_shape tests * Apply suggestions from code review Co-authored-by: Jan <[email protected]> * Adding comment about squeeze * Formating new mcmc branch * mcmc sample batched for likelihood estimator * batch sampling for snpe,snre * ruff fixes after merge * pytest not catching xfail * mcmc_posterior sample_batched disappeared in merge * move mcmc chain shape handling to mcmcposterior away from potentials * batched init strategies for mcmc * update raio_based_potential for new RatioEstimator class * mcmc sample shape out fix and process_x utils * suggestions from jan * warning on batched x --------- Co-authored-by: michaeldeistler <[email protected]> Co-authored-by: Jan Boelts <[email protected]> Co-authored-by: Jan <[email protected]> Co-authored-by: Guy Moss <[email protected]> Co-authored-by: Guy Moss <[email protected]>
- Loading branch information
1 parent
e86c761
commit 81fffcf
Showing
15 changed files
with
388 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.