PyVBMC 0.9.1__tar.gz → 1.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- PyVBMC-1.0.1/.github/workflows/build.yml +25 -0
- PyVBMC-1.0.1/.github/workflows/docs.yml +53 -0
- PyVBMC-1.0.1/.github/workflows/merge-tests.yml +87 -0
- PyVBMC-1.0.1/.github/workflows/release.yml +24 -0
- PyVBMC-1.0.1/.github/workflows/tests.yml +48 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/.gitignore +3 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/.pre-commit-config.yaml +4 -4
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/MANIFEST.in +2 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/PKG-INFO +34 -13
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/PyVBMC.egg-info/PKG-INFO +34 -13
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/PyVBMC.egg-info/SOURCES.txt +34 -3
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/PyVBMC.egg-info/requires.txt +1 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/README.md +33 -12
- PyVBMC-1.0.1/examples/pyvbmc_example_1_basic_usage.ipynb +411 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/examples/pyvbmc_example_2_inputs_outputs.ipynb +14 -5
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/examples/pyvbmc_example_3_diagnostics_and_saving.ipynb +78 -108
- PyVBMC-1.0.1/examples/pyvbmc_example_4_validation.ipynb +428 -0
- PyVBMC-1.0.1/examples/pyvbmc_example_5_prior_distributions.ipynb +452 -0
- PyVBMC-1.0.1/examples/pyvbmc_example_6_noisy_likelihoods.ipynb +307 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/examples/scripts/Makefile +1 -1
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/examples/scripts/pyvbmc_example_3_full_code.py +15 -42
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/examples/scripts/pyvbmc_example_4_full_code.py +1 -3
- PyVBMC-1.0.1/examples/scripts/pyvbmc_example_5_full_code.py +138 -0
- PyVBMC-0.9.1/examples/scripts/pyvbmc_example_5_full_code.py → PyVBMC-1.0.1/examples/scripts/pyvbmc_example_6_full_code.py +2 -4
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyproject.toml +1 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/__init__.py +1 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/function_logger/function_logger.py +1 -11
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/parameter_transformer/parameter_transformer.py +0 -10
- PyVBMC-1.0.1/pyvbmc/priors/__init__.py +12 -0
- PyVBMC-1.0.1/pyvbmc/priors/convert_to_prior.py +68 -0
- PyVBMC-1.0.1/pyvbmc/priors/prior.py +126 -0
- PyVBMC-1.0.1/pyvbmc/priors/product.py +187 -0
- PyVBMC-1.0.1/pyvbmc/priors/scipy.py +181 -0
- PyVBMC-1.0.1/pyvbmc/priors/smooth_box.py +217 -0
- PyVBMC-1.0.1/pyvbmc/priors/spline_trapezoidal.py +244 -0
- PyVBMC-1.0.1/pyvbmc/priors/tile_inputs.py +58 -0
- PyVBMC-1.0.1/pyvbmc/priors/trapezoidal.py +240 -0
- PyVBMC-1.0.1/pyvbmc/priors/uniform_box.py +151 -0
- PyVBMC-1.0.1/pyvbmc/priors/user_function.py +107 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/stats/kl_div_mvn.py +3 -0
- PyVBMC-1.0.1/pyvbmc/testing/priors/__init__.py +1 -0
- PyVBMC-1.0.1/pyvbmc/testing/priors/test_convert_to_prior.py +116 -0
- PyVBMC-1.0.1/pyvbmc/testing/priors/test_priors.py +122 -0
- PyVBMC-1.0.1/pyvbmc/testing/priors/test_product_prior.py +122 -0
- PyVBMC-1.0.1/pyvbmc/testing/priors/test_scipy_prior.py +76 -0
- PyVBMC-1.0.1/pyvbmc/testing/priors/test_smooth_box_prior.py +70 -0
- PyVBMC-1.0.1/pyvbmc/testing/priors/test_spline_trapezoid_prior.py +57 -0
- PyVBMC-1.0.1/pyvbmc/testing/priors/test_tile_inputs.py +81 -0
- PyVBMC-1.0.1/pyvbmc/testing/priors/test_trapezoid_prior.py +57 -0
- PyVBMC-1.0.1/pyvbmc/testing/priors/test_uniform_box_prior.py +49 -0
- PyVBMC-1.0.1/pyvbmc/testing/priors/test_user_function_prior.py +67 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/variational_posterior/test_variational_posterior.py +5 -2
- PyVBMC-1.0.1/pyvbmc/testing/variational_posterior/test_vp_save_and_load.py +164 -0
- PyVBMC-1.0.1/pyvbmc/testing/variational_posterior/test_vp_save_static.pkl +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/test_variational_optimization.py +20 -18
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/test_vbmc_init.py +307 -16
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/test_vbmc_loop_termination.py +46 -33
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/test_vbmc_optimize.py +10 -7
- PyVBMC-1.0.1/pyvbmc/testing/vbmc/test_vbmc_save_and_load.py +162 -0
- PyVBMC-1.0.1/pyvbmc/testing/vbmc/test_vbmc_save_static.pkl +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/timer/timer.py +0 -10
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/variational_posterior/variational_posterior.py +68 -18
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/active_sample.py +1 -2
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/create_vbmc_animation.py +50 -14
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/iteration_history.py +0 -4
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/option_configs/advanced_vbmc_options.ini +0 -4
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/option_configs/basic_vbmc_options.ini +0 -2
- PyVBMC-1.0.1/pyvbmc/vbmc/option_configs/test_options.ini +11 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/options.py +16 -38
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/variational_optimization.py +3 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/vbmc.py +227 -68
- PyVBMC-0.9.1/examples/noise_free_vp.pkl +0 -0
- PyVBMC-0.9.1/examples/pyvbmc_example_1_basic_usage.ipynb +0 -414
- PyVBMC-0.9.1/examples/pyvbmc_example_4_validation.ipynb +0 -432
- PyVBMC-0.9.1/examples/pyvbmc_example_5_noisy_likelihoods.ipynb +0 -316
- PyVBMC-0.9.1/examples/vbmc_test_save.pkl +0 -0
- PyVBMC-0.9.1/pyvbmc/vbmc/option_configs/test_options.ini +0 -7
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/.coveragerc +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/.coveragerc-html.css +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/.gitattributes +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/LICENSE +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/PyVBMC.egg-info/dependency_links.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/PyVBMC.egg-info/top_level.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/examples/scripts/pyvbmc_example_1_full_code.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/examples/scripts/pyvbmc_example_2_full_code.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/logo.svg +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pylintrc +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/__main__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/acquisition_functions/README.md +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/acquisition_functions/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/acquisition_functions/abstract_acq_fcn.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/acquisition_functions/acq_fcn.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/acquisition_functions/acq_fcn_imiqr.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/acquisition_functions/acq_fcn_log.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/acquisition_functions/acq_fcn_noisy.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/acquisition_functions/acq_fcn_vanilla.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/acquisition_functions/acq_fcn_viqr.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/acquisition_functions/utilities.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/decorators/README.md +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/decorators/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/decorators/handle_0D_1D_input.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/entropy/README.md +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/entropy/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/entropy/entlb_vbmc.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/entropy/entmc_vbmc.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/formatting/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/formatting/formatting.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/function_logger/README.md +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/function_logger/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/parameter_transformer/README.md +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/parameter_transformer/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/stats/README.md +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/stats/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/stats/get_hpd.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/stats/kde_1d.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/_check_grad.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/_compare_matlab.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/acquisition_functions/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/acquisition_functions/test_abstract_acquisition_function.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/acquisition_functions/test_acq_fcn.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/acquisition_functions/test_acq_fcn_imiqr.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/acquisition_functions/test_acq_fcn_log.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/acquisition_functions/test_acq_fcn_noisy.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/acquisition_functions/test_acq_fcn_vanilla.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/acquisition_functions/test_acq_fcn_viqr.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/decorators/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/decorators/test_handle_0D_1D_input_decorator.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/entropy/entropy-test.mat +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/entropy/test_entlb_vbmc.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/entropy/test_entmc_vbmc.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/function_logger/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/function_logger/test_function_logger.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/parameter_transformer/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/parameter_transformer/test_parameter_transformer.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/stats/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/stats/test_get_hpd.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/stats/test_kde1d.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/stats/test_kldiv_mvn.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/testing/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/testing/test_check_grad.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/timer/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/timer/test_timer.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/variational_posterior/X.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/variational_posterior/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/variational_posterior/bnd_lb.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/variational_posterior/bnd_ub.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/variational_posterior/mu.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/variational_posterior/test_moments_no_orig_flag_2_MATLAB.mat +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/variational_posterior/vp-test.mat +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/X.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/compare_MATLAB/activesample_proposalpdf.m +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/compare_MATLAB/activesample_proposalpdf.mat +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/compare_MATLAB/fess.m +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/compare_MATLAB/fess.mat +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/compare_MATLAB/log_isbasefun.m +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/compare_MATLAB/log_isbasefun.mat +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/dF.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/dG_gp_log_joint.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/hyp.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/mu.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/test_active_importance_sampling.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/test_gaussian_process_train.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/test_iteration_history.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/test_minimize_adam.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/test_options.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/test_vbmc_active_sample.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/test_vbmc_determine_best_vp.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/test_vbmc_finalboost.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/vbmc/y.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/test_rotoscaling.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/test_warp_gp_and_vp_gp_X.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/test_warp_gp_and_vp_gp_hyps.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/test_warp_gp_and_vp_gp_hyps_new.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/test_warp_gp_and_vp_gp_y.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/test_warp_gp_and_vp_vp_K.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/test_warp_gp_and_vp_vp_lambda.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/test_warp_gp_and_vp_vp_mu.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/test_warp_gp_and_vp_vp_sigma.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/test_warp_gp_and_vp_vp_w.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/test_warp_input_R_mat.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/test_warp_input_rands.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/test_warp_input_scale.txt +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/testing/whitening/vp_initialized_MATLAB.mat +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/timer/README.md +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/timer/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/variational_posterior/README.md +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/variational_posterior/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/README.md +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/active_importance_sampling.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/gaussian_process_train.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/minimize_adam.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/vbmc/option_configs/test_options2.ini +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/whitening/README.md +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/whitening/__init__.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/pyvbmc/whitening/whitening.py +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/setup.cfg +0 -0
- {PyVBMC-0.9.1 → PyVBMC-1.0.1}/setup.py +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
workflow_call:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v3
|
|
15
|
+
- uses: actions/setup-python@v4
|
|
16
|
+
name: Install Python
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.9"
|
|
19
|
+
- name: Build sdist and wheel
|
|
20
|
+
run: |
|
|
21
|
+
python -m pip install -U build setuptools_scm
|
|
22
|
+
python -m build .
|
|
23
|
+
- uses: actions/upload-artifact@v3
|
|
24
|
+
with:
|
|
25
|
+
path: dist/*
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# From https://github.com/eeholmes/readthedoc-test/blob/main/.github/workflows/docs_pages.yml
|
|
2
|
+
name: docs
|
|
3
|
+
|
|
4
|
+
# execute this workflow automatically when a we push to main
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
|
|
12
|
+
build_docs:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout main
|
|
17
|
+
uses: actions/checkout@v3
|
|
18
|
+
with:
|
|
19
|
+
path: main
|
|
20
|
+
|
|
21
|
+
- name: Checkout gh-pages
|
|
22
|
+
uses: actions/checkout@v3
|
|
23
|
+
with:
|
|
24
|
+
path: gh-pages
|
|
25
|
+
ref: gh-pages
|
|
26
|
+
|
|
27
|
+
- name: Set up Python
|
|
28
|
+
uses: actions/setup-python@v4
|
|
29
|
+
with:
|
|
30
|
+
python-version: 3.11
|
|
31
|
+
|
|
32
|
+
- name: Install dependencies
|
|
33
|
+
run: |
|
|
34
|
+
cd ./main
|
|
35
|
+
python -m pip install .[dev]
|
|
36
|
+
- name: Make the Sphinx docs
|
|
37
|
+
run: |
|
|
38
|
+
cd ./main/docsrc
|
|
39
|
+
make clean
|
|
40
|
+
make github
|
|
41
|
+
- name: Commit changes to docs
|
|
42
|
+
run: |
|
|
43
|
+
cd ./gh-pages
|
|
44
|
+
cp -R ../main/docs/* ./
|
|
45
|
+
git config --local user.email ""
|
|
46
|
+
git config --local user.name "github-actions"
|
|
47
|
+
git add -A
|
|
48
|
+
if ! git diff-index --quiet HEAD; then
|
|
49
|
+
git commit -m "auto: Rebuild docs."
|
|
50
|
+
git push
|
|
51
|
+
else
|
|
52
|
+
echo No commit made because the docs have not changed.
|
|
53
|
+
fi
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# From github.com/dfm/tinygp
|
|
2
|
+
name: merge-tests
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
pull_request:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
check_changes:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
outputs:
|
|
13
|
+
run_job: ${{ steps.check_files.outputs.run_job }}
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout PyVBMC
|
|
16
|
+
uses: actions/checkout@v3
|
|
17
|
+
with:
|
|
18
|
+
fetch-depth: 0
|
|
19
|
+
path: pyvbmc
|
|
20
|
+
|
|
21
|
+
- name: Check for modified files
|
|
22
|
+
id: check_files
|
|
23
|
+
run: |
|
|
24
|
+
cd ./pyvbmc
|
|
25
|
+
echo "=============== list modified files ==============="
|
|
26
|
+
git diff --name-only origin/main
|
|
27
|
+
|
|
28
|
+
echo "========== check paths of modified files =========="
|
|
29
|
+
git diff --name-only origin/main > files.txt
|
|
30
|
+
echo "run_job=false" >> $GITHUB_OUTPUT
|
|
31
|
+
changes=false
|
|
32
|
+
while IFS= read -r file
|
|
33
|
+
do
|
|
34
|
+
echo $file
|
|
35
|
+
if [[ ($file != pyvbmc/*) && ($file != pyproject.toml) && ($file != setup.py) ]]; then
|
|
36
|
+
:
|
|
37
|
+
else
|
|
38
|
+
echo "Change in source files found, running tests."
|
|
39
|
+
echo "run_job=true" >> $GITHUB_OUTPUT
|
|
40
|
+
changes=true
|
|
41
|
+
break
|
|
42
|
+
fi
|
|
43
|
+
done < files.txt
|
|
44
|
+
if [ "$changes" = false ]; then
|
|
45
|
+
echo "No changes to source directory found, skipping tests."
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
tests:
|
|
49
|
+
needs: check_changes
|
|
50
|
+
if: needs.check_changes.outputs.run_job == 'true'
|
|
51
|
+
strategy:
|
|
52
|
+
matrix:
|
|
53
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
54
|
+
python-version: ["3.9", "3.10", "3.11"]
|
|
55
|
+
runs-on: ${{ matrix.os }}
|
|
56
|
+
|
|
57
|
+
steps:
|
|
58
|
+
- name: Checkout PyVBMC
|
|
59
|
+
uses: actions/checkout@v3
|
|
60
|
+
with:
|
|
61
|
+
path: pyvbmc
|
|
62
|
+
|
|
63
|
+
- name: Checkout GPyReg
|
|
64
|
+
uses: actions/checkout@v3
|
|
65
|
+
with:
|
|
66
|
+
repository: acerbilab/gpyreg
|
|
67
|
+
path: gpyreg
|
|
68
|
+
|
|
69
|
+
- name: Setup Python
|
|
70
|
+
uses: actions/setup-python@v4
|
|
71
|
+
with:
|
|
72
|
+
python-version: ${{ matrix.python-version }}
|
|
73
|
+
|
|
74
|
+
- name: Install PyVBMC
|
|
75
|
+
run: |
|
|
76
|
+
cd ./pyvbmc
|
|
77
|
+
python -m pip install -e .
|
|
78
|
+
|
|
79
|
+
- name: Install GPyReg
|
|
80
|
+
run: |
|
|
81
|
+
cd ./gpyreg
|
|
82
|
+
python -m pip install -e .
|
|
83
|
+
|
|
84
|
+
- name: Run tests
|
|
85
|
+
run: |
|
|
86
|
+
cd ./pyvbmc
|
|
87
|
+
python -m pytest --reruns=5 -x -vv
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: publish-release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [created]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
uses: acerbilab/pyvbmc/.github/workflows/build.yml@main
|
|
11
|
+
upload_to_pypi:
|
|
12
|
+
needs: [build]
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Download built package
|
|
16
|
+
uses: actions/download-artifact@v3
|
|
17
|
+
with:
|
|
18
|
+
name: artifact
|
|
19
|
+
path: dist
|
|
20
|
+
|
|
21
|
+
- name: Upload to PyPI
|
|
22
|
+
uses: pypa/gh-action-pypi-publish@v1.6.4
|
|
23
|
+
with:
|
|
24
|
+
password: ${{ secrets.pypi_password }}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# From github.com/dfm/tinygp
|
|
2
|
+
name: tests
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
schedule:
|
|
7
|
+
# Run on the 13th and 28th of each month, at 00:23 UTC:
|
|
8
|
+
- cron: '23 00 13,28 * *'
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
tests:
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
15
|
+
python-version: ["3.9", "3.10", "3.11"]
|
|
16
|
+
runs-on: ${{ matrix.os }}
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout PyVBMC
|
|
20
|
+
uses: actions/checkout@v3
|
|
21
|
+
with:
|
|
22
|
+
path: pyvbmc
|
|
23
|
+
|
|
24
|
+
- name: Checkout GPyReg
|
|
25
|
+
uses: actions/checkout@v3
|
|
26
|
+
with:
|
|
27
|
+
repository: acerbilab/gpyreg
|
|
28
|
+
path: gpyreg
|
|
29
|
+
|
|
30
|
+
- name: Setup Python
|
|
31
|
+
uses: actions/setup-python@v4
|
|
32
|
+
with:
|
|
33
|
+
python-version: ${{ matrix.python-version }}
|
|
34
|
+
|
|
35
|
+
- name: Install PyVBMC
|
|
36
|
+
run: |
|
|
37
|
+
cd ./pyvbmc
|
|
38
|
+
python -m pip install -e .
|
|
39
|
+
|
|
40
|
+
- name: Install GPyReg
|
|
41
|
+
run: |
|
|
42
|
+
cd ./gpyreg
|
|
43
|
+
python -m pip install -e .
|
|
44
|
+
|
|
45
|
+
- name: Run tests
|
|
46
|
+
run: |
|
|
47
|
+
cd ./pyvbmc
|
|
48
|
+
python -m pytest --reruns=5 -x -vv
|
|
@@ -62,6 +62,9 @@ coverage.xml
|
|
|
62
62
|
.pytest_cache/
|
|
63
63
|
cover/
|
|
64
64
|
pyvbmc/testing/vbmc/vbmc_test.pkl
|
|
65
|
+
pyvbmc/testing/vbmc/test_vbmc_save_dynamic.pkl
|
|
66
|
+
pyvbmc/testing/vbmc/test_vbmc_save_dynamic_data.pkl
|
|
67
|
+
pyvbmc/testing/variational_posterior/test_vp_save_dynamic.pkl
|
|
65
68
|
|
|
66
69
|
# Translations
|
|
67
70
|
*.mo
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
repos:
|
|
2
2
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
-
rev: v4.
|
|
3
|
+
rev: v4.4.0
|
|
4
4
|
hooks:
|
|
5
5
|
- id: trailing-whitespace
|
|
6
6
|
exclude: ^docs/
|
|
@@ -8,16 +8,16 @@ repos:
|
|
|
8
8
|
exclude_types: [json, binary]
|
|
9
9
|
exclude: ^docs/
|
|
10
10
|
- repo: https://github.com/PyCQA/isort
|
|
11
|
-
rev: "5.
|
|
11
|
+
rev: "5.12.0"
|
|
12
12
|
hooks:
|
|
13
13
|
- id: isort
|
|
14
14
|
additional_dependencies: [toml]
|
|
15
15
|
exclude: docs/tutorials
|
|
16
16
|
- repo: https://github.com/psf/black
|
|
17
|
-
rev: "
|
|
17
|
+
rev: "23.3.0"
|
|
18
18
|
hooks:
|
|
19
19
|
- id: black-jupyter
|
|
20
20
|
- repo: https://github.com/hadialqattan/pycln
|
|
21
|
-
rev: "
|
|
21
|
+
rev: "v2.1.3"
|
|
22
22
|
hooks:
|
|
23
23
|
- id: pycln
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
include pyvbmc/testing/variational_posterior/*.txt
|
|
2
2
|
include pyvbmc/testing/variational_posterior/*.mat
|
|
3
|
+
include pyvbmc/testing/variational_posterior/test_vp_save_static.pkl
|
|
3
4
|
include pyvbmc/testing/vbmc/*.txt
|
|
4
5
|
include pyvbmc/testing/vbmc/compare_MATLAB/*
|
|
6
|
+
include pyvbmc/testing/vbmc/test_vbmc_save_static.pkl
|
|
5
7
|
prune docsrc
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyVBMC
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Variational Bayesian Monte Carlo in Python.
|
|
5
5
|
License: BSD 3-Clause License
|
|
6
6
|
|
|
@@ -37,11 +37,20 @@ Description-Content-Type: text/markdown
|
|
|
37
37
|
Provides-Extra: dev
|
|
38
38
|
License-File: LICENSE
|
|
39
39
|
|
|
40
|
-

|
|
41
|
+
|
|
41
42
|
# PyVBMC: Variational Bayesian Monte Carlo in Python
|
|
43
|
+

|
|
44
|
+
[](https://anaconda.org/conda-forge/pyvbmc)
|
|
45
|
+
[](https://pypi.org/project/pyvbmc/)
|
|
46
|
+
<br />
|
|
47
|
+
[](https://github.com/orgs/acerbilab/discussions)
|
|
48
|
+
[](https://github.com/acerbilab/pyvbmc/actions/workflows/tests.yml)
|
|
49
|
+
[](https://github.com/acerbilab/pyvbmc/actions/workflows/docs.yml)
|
|
50
|
+
[](https://github.com/acerbilab/pyvbmc/actions/workflows/build.yml)
|
|
42
51
|
### What is it?
|
|
43
52
|
|
|
44
|
-
PyVBMC is a Python implementation of the Variational Bayesian Monte Carlo (VBMC) algorithm for posterior and model inference,
|
|
53
|
+
PyVBMC is a Python implementation of the Variational Bayesian Monte Carlo (VBMC) algorithm for posterior and model inference, previously implemented [in MATLAB](https://github.com/acerbilab/vbmc). VBMC is an approximate inference method designed to fit and evaluate Bayesian models with a limited budget of potentially noisy likelihood evaluations (e.g., for computationally expensive models). Specifically, VBMC simultaneously computes:
|
|
45
54
|
- an approximate posterior distribution of the model parameters;
|
|
46
55
|
- an approximation — technically, an approximate lower bound — of the log model evidence (also known as log marginal likelihood or log Bayes factor), a metric used for [Bayesian model selection](https://en.wikipedia.org/wiki/Bayes_factor).
|
|
47
56
|
|
|
@@ -63,6 +72,8 @@ PyVBMC is effective when:
|
|
|
63
72
|
|
|
64
73
|
Conversely, if your model can be written analytically, you should exploit the powerful machinery of probabilistic programming frameworks such as [Stan](http://mc-stan.org/) or [PyMC](https://docs.pymc.io/).
|
|
65
74
|
|
|
75
|
+
Note: If you are interested in point estimates or in finding better starting points for PyVBMC, check out [Bayesian Adaptive Direct Search in Python (PyBADS)](https://github.com/acerbilab/pybads), our companion method for fast Bayesian optimization.
|
|
76
|
+
|
|
66
77
|
## Installation
|
|
67
78
|
|
|
68
79
|
PyVBMC is available via `pip` and `conda-forge`.
|
|
@@ -108,7 +119,7 @@ vbmc = VBMC(target, x0, LB, UB, PLB, PUB)
|
|
|
108
119
|
vp, results = vbmc.optimize()
|
|
109
120
|
```
|
|
110
121
|
with input arguments:
|
|
111
|
-
- `target`: the target (unnormalized) log density — often an unnormalized log posterior. `target` is a callable that should take as input a parameter vector and return the log density at the point;
|
|
122
|
+
- `target`: the target (unnormalized) log density — often an unnormalized log posterior. `target` is a callable that should take as input a parameter vector and return the log density at the point. The returned log density must return a *finite* real value, i.e. non `NaN` or `-inf`. See the [VBMC FAQ](https://github.com/acerbilab/vbmc/wiki#how-do-i-prevent-vbmc-from-evaluating-certain-inputs-or-regions-of-input-space) for more details;
|
|
112
123
|
- `x0`: an array representing the starting point of the inference in parameter space;
|
|
113
124
|
- `LB` and `UB`: arrays of hard lower (resp. upper) bounds constraining the parameters (possibly `-/+np.inf` for unbounded parameters);
|
|
114
125
|
- `PLB` and `PUB`: arrays of plausible lower (resp. upper) bounds: that is, a box that ideally brackets a high posterior density region of the target.
|
|
@@ -146,7 +157,7 @@ This matching process entails optimization of the *evidence lower bound* (ELBO),
|
|
|
146
157
|
|
|
147
158
|
In each iteration, PyVBMC uses *active sampling* to select which points to evaluate next in order to explore the posterior landscape and reduce uncertainty in the approximation.
|
|
148
159
|
|
|
149
|
-

|
|
150
161
|
|
|
151
162
|
In the figure above, we show an example PyVBMC run on a [Rosenbrock "banana" function](https://en.wikipedia.org/wiki/Rosenbrock_function). The bottom-left panel shows PyVBMC at work: in grayscale are samples from the variational posterior (drawn as small points) and the corresponding estimated density (drawn as contours). The solid orange circles are the active sampling points chosen at each iteration, and the hollow blue circles are the previously sampled points. The topmost and rightnmost panels show histograms of the marginal densities along the $x_1$ and $x_2$ dimensions, respectively. PyVBMC converges to an excellent approximation of the true posterior with a few dozens evaluations of the target density.
|
|
152
163
|
|
|
@@ -154,7 +165,7 @@ See the VBMC papers [[1,2](#references-and-citation)] for more details.
|
|
|
154
165
|
|
|
155
166
|
## Troubleshooting and contact
|
|
156
167
|
|
|
157
|
-
PyVBMC is under active development. The
|
|
168
|
+
PyVBMC is under active development. The VBMC algorithm has been extensively tested in several benchmarks and published papers, and the benchmarks have been replicated using PyVBMC. But as with any approximate inference technique, you should double-check your results. See the [examples](examples) for descriptions of the convergence diagnostics and suggestions on validating PyVBMC's results with multiple runs.
|
|
158
169
|
|
|
159
170
|
If you have trouble doing something with PyVBMC, spot bugs or strange behavior, or you simply have some questions, please feel free to:
|
|
160
171
|
- Post in the lab's [Discussions forum](https://github.com/orgs/acerbilab/discussions) with questions or comments about PyVBMC, your problems & applications;
|
|
@@ -163,12 +174,13 @@ If you have trouble doing something with PyVBMC, spot bugs or strange behavior,
|
|
|
163
174
|
|
|
164
175
|
## References and citation
|
|
165
176
|
|
|
166
|
-
1.
|
|
167
|
-
2. Acerbi, L. (
|
|
177
|
+
1. Huggins, B., Li, C., Tobaben, M., Aarnos, M., & Acerbi, L. (2023). *PyVBMC: Efficient Bayesian inference in Python*. arXiv. https://arxiv.org/abs/2303.09519
|
|
178
|
+
2. Acerbi, L. (2018). Variational Bayesian Monte Carlo. In *Advances in Neural Information Processing Systems 31*: 8222-8232. ([paper + supplement on arXiv](https://arxiv.org/abs/1810.05558), [NeurIPS Proceedings](https://papers.nips.cc/paper/8043-variational-bayesian-monte-carlo))
|
|
179
|
+
3. Acerbi, L. (2020). Variational Bayesian Monte Carlo with Noisy Likelihoods. In *Advances in Neural Information Processing Systems 33*: 8211-8222 ([paper + supplement on arXiv](https://arxiv.org/abs/2006.08655), [NeurIPS Proceedings](https://papers.nips.cc/paper/2020/hash/5d40954183d62a82257835477ccad3d2-Abstract.html)).
|
|
168
180
|
|
|
169
|
-
Please cite
|
|
181
|
+
Please cite all three references if you use PyVBMC in your work (the 2018 paper introduced the framework, and the 2020 paper includes a number of major improvements, including but not limited to support for noisy likelihoods). You can cite PyVBMC in your work with something along the lines of
|
|
170
182
|
|
|
171
|
-
> We estimated approximate posterior distibutions and approximate lower bounds to the model evidence of our models using Variational Bayesian Monte Carlo (PyVBMC; Acerbi, 2018, 2020). PyVBMC combines variational inference and active-sampling Bayesian quadrature to perform approximate Bayesian inference in a sample-efficient manner.
|
|
183
|
+
> We estimated approximate posterior distibutions and approximate lower bounds to the model evidence of our models using Variational Bayesian Monte Carlo (PyVBMC; Acerbi, 2018, 2020) via the PyVBMC software (Huggins et al., 2023). PyVBMC combines variational inference and active-sampling Bayesian quadrature to perform approximate Bayesian inference in a sample-efficient manner.
|
|
172
184
|
|
|
173
185
|
Besides formal citations, you can demonstrate your appreciation for PyVBMC in the following ways:
|
|
174
186
|
|
|
@@ -177,15 +189,24 @@ Besides formal citations, you can demonstrate your appreciation for PyVBMC in th
|
|
|
177
189
|
- [Follow Luigi Acerbi on Twitter](https://twitter.com/AcerbiLuigi) for updates about VBMC/PyVBMC and other projects;
|
|
178
190
|
- Tell us about your model-fitting problem and your experience with PyVBMC (positive or negative) in the lab's [Discussions forum](https://github.com/orgs/acerbilab/discussions).
|
|
179
191
|
|
|
180
|
-
You may also want to check out [Bayesian Adaptive Direct Search](https://github.com/acerbilab/
|
|
192
|
+
You may also want to check out [Bayesian Adaptive Direct Search in Python (PyBADS)](https://github.com/acerbilab/pybads), our companion method for fast Bayesian optimization.
|
|
181
193
|
|
|
182
194
|
### Additional references
|
|
183
195
|
|
|
184
|
-
|
|
196
|
+
4. Acerbi, L. (2019). An Exploration of Acquisition and Mean Functions in Variational Bayesian Monte Carlo. In *Proc. Machine Learning Research* 96: 1-10. 1st Symposium on Advances in Approximate Bayesian Inference, Montréal, Canada. ([paper in PMLR](http://proceedings.mlr.press/v96/acerbi19a.html))
|
|
185
197
|
|
|
186
198
|
### BibTeX
|
|
187
199
|
|
|
188
200
|
```BibTeX
|
|
201
|
+
@article{huggins2023pyvbmc,
|
|
202
|
+
title = {PyVBMC: Efficient Bayesian inference in Python},
|
|
203
|
+
author = {Huggins, Bobby and Li, Chengkun and Tobaben, Marlon and Aarnos, Mikko J. and Acerbi, Luigi},
|
|
204
|
+
publisher = {preprint},
|
|
205
|
+
journal = {{arXiv}},
|
|
206
|
+
url = {https://arxiv.org/abs/2303.09519},
|
|
207
|
+
doi = {10.48550/ARXIV.2303.09519},
|
|
208
|
+
year = {2023},
|
|
209
|
+
}
|
|
189
210
|
@article{acerbi2018variational,
|
|
190
211
|
title={{V}ariational {B}ayesian {M}onte {C}arlo},
|
|
191
212
|
author={Acerbi, Luigi},
|
|
@@ -220,4 +241,4 @@ PyVBMC is released under the terms of the [BSD 3-Clause License](LICENSE).
|
|
|
220
241
|
|
|
221
242
|
### Acknowledgments
|
|
222
243
|
|
|
223
|
-
PyVBMC was developed
|
|
244
|
+
PyVBMC was developed by [members](https://www.helsinki.fi/en/researchgroups/machine-and-human-intelligence/people) (past and current) of the [Machine and Human Intelligence Lab](https://www.helsinki.fi/en/researchgroups/machine-and-human-intelligence/) at the University of Helsinki. Work on the PyVBMC package was supported by the Academy of Finland Flagship programme: [Finnish Center for Artificial Intelligence FCAI](https://fcai.fi/).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyVBMC
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Variational Bayesian Monte Carlo in Python.
|
|
5
5
|
License: BSD 3-Clause License
|
|
6
6
|
|
|
@@ -37,11 +37,20 @@ Description-Content-Type: text/markdown
|
|
|
37
37
|
Provides-Extra: dev
|
|
38
38
|
License-File: LICENSE
|
|
39
39
|
|
|
40
|
-

|
|
41
|
+
|
|
41
42
|
# PyVBMC: Variational Bayesian Monte Carlo in Python
|
|
43
|
+

|
|
44
|
+
[](https://anaconda.org/conda-forge/pyvbmc)
|
|
45
|
+
[](https://pypi.org/project/pyvbmc/)
|
|
46
|
+
<br />
|
|
47
|
+
[](https://github.com/orgs/acerbilab/discussions)
|
|
48
|
+
[](https://github.com/acerbilab/pyvbmc/actions/workflows/tests.yml)
|
|
49
|
+
[](https://github.com/acerbilab/pyvbmc/actions/workflows/docs.yml)
|
|
50
|
+
[](https://github.com/acerbilab/pyvbmc/actions/workflows/build.yml)
|
|
42
51
|
### What is it?
|
|
43
52
|
|
|
44
|
-
PyVBMC is a Python implementation of the Variational Bayesian Monte Carlo (VBMC) algorithm for posterior and model inference,
|
|
53
|
+
PyVBMC is a Python implementation of the Variational Bayesian Monte Carlo (VBMC) algorithm for posterior and model inference, previously implemented [in MATLAB](https://github.com/acerbilab/vbmc). VBMC is an approximate inference method designed to fit and evaluate Bayesian models with a limited budget of potentially noisy likelihood evaluations (e.g., for computationally expensive models). Specifically, VBMC simultaneously computes:
|
|
45
54
|
- an approximate posterior distribution of the model parameters;
|
|
46
55
|
- an approximation — technically, an approximate lower bound — of the log model evidence (also known as log marginal likelihood or log Bayes factor), a metric used for [Bayesian model selection](https://en.wikipedia.org/wiki/Bayes_factor).
|
|
47
56
|
|
|
@@ -63,6 +72,8 @@ PyVBMC is effective when:
|
|
|
63
72
|
|
|
64
73
|
Conversely, if your model can be written analytically, you should exploit the powerful machinery of probabilistic programming frameworks such as [Stan](http://mc-stan.org/) or [PyMC](https://docs.pymc.io/).
|
|
65
74
|
|
|
75
|
+
Note: If you are interested in point estimates or in finding better starting points for PyVBMC, check out [Bayesian Adaptive Direct Search in Python (PyBADS)](https://github.com/acerbilab/pybads), our companion method for fast Bayesian optimization.
|
|
76
|
+
|
|
66
77
|
## Installation
|
|
67
78
|
|
|
68
79
|
PyVBMC is available via `pip` and `conda-forge`.
|
|
@@ -108,7 +119,7 @@ vbmc = VBMC(target, x0, LB, UB, PLB, PUB)
|
|
|
108
119
|
vp, results = vbmc.optimize()
|
|
109
120
|
```
|
|
110
121
|
with input arguments:
|
|
111
|
-
- `target`: the target (unnormalized) log density — often an unnormalized log posterior. `target` is a callable that should take as input a parameter vector and return the log density at the point;
|
|
122
|
+
- `target`: the target (unnormalized) log density — often an unnormalized log posterior. `target` is a callable that should take as input a parameter vector and return the log density at the point. The returned log density must return a *finite* real value, i.e. non `NaN` or `-inf`. See the [VBMC FAQ](https://github.com/acerbilab/vbmc/wiki#how-do-i-prevent-vbmc-from-evaluating-certain-inputs-or-regions-of-input-space) for more details;
|
|
112
123
|
- `x0`: an array representing the starting point of the inference in parameter space;
|
|
113
124
|
- `LB` and `UB`: arrays of hard lower (resp. upper) bounds constraining the parameters (possibly `-/+np.inf` for unbounded parameters);
|
|
114
125
|
- `PLB` and `PUB`: arrays of plausible lower (resp. upper) bounds: that is, a box that ideally brackets a high posterior density region of the target.
|
|
@@ -146,7 +157,7 @@ This matching process entails optimization of the *evidence lower bound* (ELBO),
|
|
|
146
157
|
|
|
147
158
|
In each iteration, PyVBMC uses *active sampling* to select which points to evaluate next in order to explore the posterior landscape and reduce uncertainty in the approximation.
|
|
148
159
|
|
|
149
|
-

|
|
150
161
|
|
|
151
162
|
In the figure above, we show an example PyVBMC run on a [Rosenbrock "banana" function](https://en.wikipedia.org/wiki/Rosenbrock_function). The bottom-left panel shows PyVBMC at work: in grayscale are samples from the variational posterior (drawn as small points) and the corresponding estimated density (drawn as contours). The solid orange circles are the active sampling points chosen at each iteration, and the hollow blue circles are the previously sampled points. The topmost and rightnmost panels show histograms of the marginal densities along the $x_1$ and $x_2$ dimensions, respectively. PyVBMC converges to an excellent approximation of the true posterior with a few dozens evaluations of the target density.
|
|
152
163
|
|
|
@@ -154,7 +165,7 @@ See the VBMC papers [[1,2](#references-and-citation)] for more details.
|
|
|
154
165
|
|
|
155
166
|
## Troubleshooting and contact
|
|
156
167
|
|
|
157
|
-
PyVBMC is under active development. The
|
|
168
|
+
PyVBMC is under active development. The VBMC algorithm has been extensively tested in several benchmarks and published papers, and the benchmarks have been replicated using PyVBMC. But as with any approximate inference technique, you should double-check your results. See the [examples](examples) for descriptions of the convergence diagnostics and suggestions on validating PyVBMC's results with multiple runs.
|
|
158
169
|
|
|
159
170
|
If you have trouble doing something with PyVBMC, spot bugs or strange behavior, or you simply have some questions, please feel free to:
|
|
160
171
|
- Post in the lab's [Discussions forum](https://github.com/orgs/acerbilab/discussions) with questions or comments about PyVBMC, your problems & applications;
|
|
@@ -163,12 +174,13 @@ If you have trouble doing something with PyVBMC, spot bugs or strange behavior,
|
|
|
163
174
|
|
|
164
175
|
## References and citation
|
|
165
176
|
|
|
166
|
-
1.
|
|
167
|
-
2. Acerbi, L. (
|
|
177
|
+
1. Huggins, B., Li, C., Tobaben, M., Aarnos, M., & Acerbi, L. (2023). *PyVBMC: Efficient Bayesian inference in Python*. arXiv. https://arxiv.org/abs/2303.09519
|
|
178
|
+
2. Acerbi, L. (2018). Variational Bayesian Monte Carlo. In *Advances in Neural Information Processing Systems 31*: 8222-8232. ([paper + supplement on arXiv](https://arxiv.org/abs/1810.05558), [NeurIPS Proceedings](https://papers.nips.cc/paper/8043-variational-bayesian-monte-carlo))
|
|
179
|
+
3. Acerbi, L. (2020). Variational Bayesian Monte Carlo with Noisy Likelihoods. In *Advances in Neural Information Processing Systems 33*: 8211-8222 ([paper + supplement on arXiv](https://arxiv.org/abs/2006.08655), [NeurIPS Proceedings](https://papers.nips.cc/paper/2020/hash/5d40954183d62a82257835477ccad3d2-Abstract.html)).
|
|
168
180
|
|
|
169
|
-
Please cite
|
|
181
|
+
Please cite all three references if you use PyVBMC in your work (the 2018 paper introduced the framework, and the 2020 paper includes a number of major improvements, including but not limited to support for noisy likelihoods). You can cite PyVBMC in your work with something along the lines of
|
|
170
182
|
|
|
171
|
-
> We estimated approximate posterior distibutions and approximate lower bounds to the model evidence of our models using Variational Bayesian Monte Carlo (PyVBMC; Acerbi, 2018, 2020). PyVBMC combines variational inference and active-sampling Bayesian quadrature to perform approximate Bayesian inference in a sample-efficient manner.
|
|
183
|
+
> We estimated approximate posterior distibutions and approximate lower bounds to the model evidence of our models using Variational Bayesian Monte Carlo (PyVBMC; Acerbi, 2018, 2020) via the PyVBMC software (Huggins et al., 2023). PyVBMC combines variational inference and active-sampling Bayesian quadrature to perform approximate Bayesian inference in a sample-efficient manner.
|
|
172
184
|
|
|
173
185
|
Besides formal citations, you can demonstrate your appreciation for PyVBMC in the following ways:
|
|
174
186
|
|
|
@@ -177,15 +189,24 @@ Besides formal citations, you can demonstrate your appreciation for PyVBMC in th
|
|
|
177
189
|
- [Follow Luigi Acerbi on Twitter](https://twitter.com/AcerbiLuigi) for updates about VBMC/PyVBMC and other projects;
|
|
178
190
|
- Tell us about your model-fitting problem and your experience with PyVBMC (positive or negative) in the lab's [Discussions forum](https://github.com/orgs/acerbilab/discussions).
|
|
179
191
|
|
|
180
|
-
You may also want to check out [Bayesian Adaptive Direct Search](https://github.com/acerbilab/
|
|
192
|
+
You may also want to check out [Bayesian Adaptive Direct Search in Python (PyBADS)](https://github.com/acerbilab/pybads), our companion method for fast Bayesian optimization.
|
|
181
193
|
|
|
182
194
|
### Additional references
|
|
183
195
|
|
|
184
|
-
|
|
196
|
+
4. Acerbi, L. (2019). An Exploration of Acquisition and Mean Functions in Variational Bayesian Monte Carlo. In *Proc. Machine Learning Research* 96: 1-10. 1st Symposium on Advances in Approximate Bayesian Inference, Montréal, Canada. ([paper in PMLR](http://proceedings.mlr.press/v96/acerbi19a.html))
|
|
185
197
|
|
|
186
198
|
### BibTeX
|
|
187
199
|
|
|
188
200
|
```BibTeX
|
|
201
|
+
@article{huggins2023pyvbmc,
|
|
202
|
+
title = {PyVBMC: Efficient Bayesian inference in Python},
|
|
203
|
+
author = {Huggins, Bobby and Li, Chengkun and Tobaben, Marlon and Aarnos, Mikko J. and Acerbi, Luigi},
|
|
204
|
+
publisher = {preprint},
|
|
205
|
+
journal = {{arXiv}},
|
|
206
|
+
url = {https://arxiv.org/abs/2303.09519},
|
|
207
|
+
doi = {10.48550/ARXIV.2303.09519},
|
|
208
|
+
year = {2023},
|
|
209
|
+
}
|
|
189
210
|
@article{acerbi2018variational,
|
|
190
211
|
title={{V}ariational {B}ayesian {M}onte {C}arlo},
|
|
191
212
|
author={Acerbi, Luigi},
|
|
@@ -220,4 +241,4 @@ PyVBMC is released under the terms of the [BSD 3-Clause License](LICENSE).
|
|
|
220
241
|
|
|
221
242
|
### Acknowledgments
|
|
222
243
|
|
|
223
|
-
PyVBMC was developed
|
|
244
|
+
PyVBMC was developed by [members](https://www.helsinki.fi/en/researchgroups/machine-and-human-intelligence/people) (past and current) of the [Machine and Human Intelligence Lab](https://www.helsinki.fi/en/researchgroups/machine-and-human-intelligence/) at the University of Helsinki. Work on the PyVBMC package was supported by the Academy of Finland Flagship programme: [Finnish Center for Artificial Intelligence FCAI](https://fcai.fi/).
|
|
@@ -10,24 +10,29 @@ logo.svg
|
|
|
10
10
|
pylintrc
|
|
11
11
|
pyproject.toml
|
|
12
12
|
setup.py
|
|
13
|
+
.github/workflows/build.yml
|
|
14
|
+
.github/workflows/docs.yml
|
|
15
|
+
.github/workflows/merge-tests.yml
|
|
16
|
+
.github/workflows/release.yml
|
|
17
|
+
.github/workflows/tests.yml
|
|
13
18
|
PyVBMC.egg-info/PKG-INFO
|
|
14
19
|
PyVBMC.egg-info/SOURCES.txt
|
|
15
20
|
PyVBMC.egg-info/dependency_links.txt
|
|
16
21
|
PyVBMC.egg-info/requires.txt
|
|
17
22
|
PyVBMC.egg-info/top_level.txt
|
|
18
|
-
examples/noise_free_vp.pkl
|
|
19
23
|
examples/pyvbmc_example_1_basic_usage.ipynb
|
|
20
24
|
examples/pyvbmc_example_2_inputs_outputs.ipynb
|
|
21
25
|
examples/pyvbmc_example_3_diagnostics_and_saving.ipynb
|
|
22
26
|
examples/pyvbmc_example_4_validation.ipynb
|
|
23
|
-
examples/
|
|
24
|
-
examples/
|
|
27
|
+
examples/pyvbmc_example_5_prior_distributions.ipynb
|
|
28
|
+
examples/pyvbmc_example_6_noisy_likelihoods.ipynb
|
|
25
29
|
examples/scripts/Makefile
|
|
26
30
|
examples/scripts/pyvbmc_example_1_full_code.py
|
|
27
31
|
examples/scripts/pyvbmc_example_2_full_code.py
|
|
28
32
|
examples/scripts/pyvbmc_example_3_full_code.py
|
|
29
33
|
examples/scripts/pyvbmc_example_4_full_code.py
|
|
30
34
|
examples/scripts/pyvbmc_example_5_full_code.py
|
|
35
|
+
examples/scripts/pyvbmc_example_6_full_code.py
|
|
31
36
|
pyvbmc/__init__.py
|
|
32
37
|
pyvbmc/__main__.py
|
|
33
38
|
pyvbmc/acquisition_functions/README.md
|
|
@@ -55,6 +60,17 @@ pyvbmc/function_logger/function_logger.py
|
|
|
55
60
|
pyvbmc/parameter_transformer/README.md
|
|
56
61
|
pyvbmc/parameter_transformer/__init__.py
|
|
57
62
|
pyvbmc/parameter_transformer/parameter_transformer.py
|
|
63
|
+
pyvbmc/priors/__init__.py
|
|
64
|
+
pyvbmc/priors/convert_to_prior.py
|
|
65
|
+
pyvbmc/priors/prior.py
|
|
66
|
+
pyvbmc/priors/product.py
|
|
67
|
+
pyvbmc/priors/scipy.py
|
|
68
|
+
pyvbmc/priors/smooth_box.py
|
|
69
|
+
pyvbmc/priors/spline_trapezoidal.py
|
|
70
|
+
pyvbmc/priors/tile_inputs.py
|
|
71
|
+
pyvbmc/priors/trapezoidal.py
|
|
72
|
+
pyvbmc/priors/uniform_box.py
|
|
73
|
+
pyvbmc/priors/user_function.py
|
|
58
74
|
pyvbmc/stats/README.md
|
|
59
75
|
pyvbmc/stats/__init__.py
|
|
60
76
|
pyvbmc/stats/get_hpd.py
|
|
@@ -80,6 +96,17 @@ pyvbmc/testing/function_logger/__init__.py
|
|
|
80
96
|
pyvbmc/testing/function_logger/test_function_logger.py
|
|
81
97
|
pyvbmc/testing/parameter_transformer/__init__.py
|
|
82
98
|
pyvbmc/testing/parameter_transformer/test_parameter_transformer.py
|
|
99
|
+
pyvbmc/testing/priors/__init__.py
|
|
100
|
+
pyvbmc/testing/priors/test_convert_to_prior.py
|
|
101
|
+
pyvbmc/testing/priors/test_priors.py
|
|
102
|
+
pyvbmc/testing/priors/test_product_prior.py
|
|
103
|
+
pyvbmc/testing/priors/test_scipy_prior.py
|
|
104
|
+
pyvbmc/testing/priors/test_smooth_box_prior.py
|
|
105
|
+
pyvbmc/testing/priors/test_spline_trapezoid_prior.py
|
|
106
|
+
pyvbmc/testing/priors/test_tile_inputs.py
|
|
107
|
+
pyvbmc/testing/priors/test_trapezoid_prior.py
|
|
108
|
+
pyvbmc/testing/priors/test_uniform_box_prior.py
|
|
109
|
+
pyvbmc/testing/priors/test_user_function_prior.py
|
|
83
110
|
pyvbmc/testing/stats/__init__.py
|
|
84
111
|
pyvbmc/testing/stats/test_get_hpd.py
|
|
85
112
|
pyvbmc/testing/stats/test_kde1d.py
|
|
@@ -95,6 +122,8 @@ pyvbmc/testing/variational_posterior/bnd_ub.txt
|
|
|
95
122
|
pyvbmc/testing/variational_posterior/mu.txt
|
|
96
123
|
pyvbmc/testing/variational_posterior/test_moments_no_orig_flag_2_MATLAB.mat
|
|
97
124
|
pyvbmc/testing/variational_posterior/test_variational_posterior.py
|
|
125
|
+
pyvbmc/testing/variational_posterior/test_vp_save_and_load.py
|
|
126
|
+
pyvbmc/testing/variational_posterior/test_vp_save_static.pkl
|
|
98
127
|
pyvbmc/testing/variational_posterior/vp-test.mat
|
|
99
128
|
pyvbmc/testing/vbmc/X.txt
|
|
100
129
|
pyvbmc/testing/vbmc/__init__.py
|
|
@@ -114,6 +143,8 @@ pyvbmc/testing/vbmc/test_vbmc_finalboost.py
|
|
|
114
143
|
pyvbmc/testing/vbmc/test_vbmc_init.py
|
|
115
144
|
pyvbmc/testing/vbmc/test_vbmc_loop_termination.py
|
|
116
145
|
pyvbmc/testing/vbmc/test_vbmc_optimize.py
|
|
146
|
+
pyvbmc/testing/vbmc/test_vbmc_save_and_load.py
|
|
147
|
+
pyvbmc/testing/vbmc/test_vbmc_save_static.pkl
|
|
117
148
|
pyvbmc/testing/vbmc/y.txt
|
|
118
149
|
pyvbmc/testing/vbmc/compare_MATLAB/activesample_proposalpdf.m
|
|
119
150
|
pyvbmc/testing/vbmc/compare_MATLAB/activesample_proposalpdf.mat
|