Skip to content

Add MLDA stepper #3926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 89 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
de8ece3
Add basic MLDA-MCMC algorithm (proposal and step method)
gmingas Mar 16, 2020
f64e320
Add example scripts for MLDA
gmingas Mar 16, 2020
0adaa61
Make coarse_models kwarg into a normal argument
gmingas Mar 16, 2020
8f22f5b
Fix docstring in MLDA class
gmingas Mar 16, 2020
b7265c9
Fix examples code style/comments
gmingas Mar 16, 2020
176a462
Remove redundant code, improve comments
gmingas Apr 1, 2020
0bb744b
Make MLDA do block sampling by default
gmingas Apr 6, 2020
e264930
Add new MLDA example with FEniCS black box component
gmingas Apr 6, 2020
3f27028
Small change in readme
gmingas Apr 6, 2020
329de99
Add run instructions in readme
gmingas Apr 6, 2020
ff12072
Change example parameters in sample()
gmingas Apr 6, 2020
84e23aa
Minor changes and comments
gmingas Apr 6, 2020
59b5512
Add extra parameters in readme
gmingas Apr 6, 2020
a3168f6
Number of chains change
gmingas Apr 6, 2020
a5c952e
Make changes to mlda example parameters, go back to compound sampling…
gmingas Apr 6, 2020
60344bd
Updated the FEniCS code so it's more efficient
mikkelbue Apr 7, 2020
2522415
Add eigenpairs projection and change input parameters
gmingas Apr 7, 2020
d2367e8
Edit readme to reflect projection function
gmingas Apr 7, 2020
e98e406
Add compound step support and improve example.py
gmingas Apr 8, 2020
5193440
Update readme
gmingas Apr 8, 2020
1ba2bd5
Add new tests tests, most of them failing
gmingas Apr 14, 2020
f21e086
Fix test_types bug
gmingas Apr 14, 2020
a3e4a75
Refactoring of MLDA to allow retaining all methods information
gmingas Apr 14, 2020
a50e80e
Add more tests
gmingas Apr 20, 2020
3d1a787
Pass more parameters to Metropolis init
gmingas Apr 21, 2020
6e7c718
Complete tuning continuation, add basic block/coumpound parameter
gmingas Apr 28, 2020
6cc612d
Remove some mlda if statements and simplify other parts
gmingas Apr 28, 2020
fd0f5b7
Change example parameters
gmingas Apr 28, 2020
1f3f1ef
Add and fix tests
gmingas Apr 29, 2020
bedb508
Add some comments and remove redundant code
gmingas Apr 29, 2020
7dd04af
Add xfail to test_models_utils test when new pandas version are used
gmingas Apr 30, 2020
b0948ff
Add description to test_examples for multilevel normal example
gmingas Apr 30, 2020
ad7b661
Remove xfail related to pandas in test_models_utils, remove redundant…
gmingas Apr 30, 2020
f835aa3
Try removing failing test
gmingas May 4, 2020
b7005ae
Remove redundant code
gmingas May 4, 2020
db2f041
Skip some failing tests
gmingas May 5, 2020
8b49ad6
Add sine wave test in test_examples
gmingas May 5, 2020
e240167
Change true parameters index
gmingas May 5, 2020
32cfd58
Fix index j in coarse models loop to avoid warning
gmingas May 5, 2020
0472c7b
Remove sine test
gmingas May 5, 2020
610993d
Remove unused library
gmingas May 5, 2020
a5b8943
Improve docstrings and remove some redundant code/comments
gmingas May 5, 2020
c5fbd85
Revert some pointless changes to tests
gmingas May 5, 2020
5107b7f
Fix style
gmingas May 5, 2020
c58781f
Add notebook example and utility code
gmingas May 5, 2020
db1d4d8
Remove old mlda example and update notebook
gmingas May 6, 2020
ce70800
Update notebook again
gmingas May 6, 2020
ce89f7f
Change the citation and add a use example to the MLDA docstring
gmingas May 6, 2020
2527a12
Change competence to be incompatible with discrete vars, remove discr…
gmingas May 7, 2020
1321ab6
Add young warning and change default subsampling value
gmingas May 7, 2020
2c6310c
Add more comments, change sys.exit to exception, change tests to refl…
gmingas May 7, 2020
113eb15
Add is_mlda_flag to prevent tuning reset when Metropolis is used as t…
gmingas May 7, 2020
8e1e5df
Add more extensive docstrings
gmingas May 7, 2020
6f98570
Re-run and re-render notebook after changes
gmingas May 7, 2020
bafb733
Add tuning for tune and scaling and refactor some parameter names to …
gmingas May 7, 2020
2ef6935
Regenerate notebook and add .py version of it
gmingas May 7, 2020
cf1be15
Delete notebook with old name
gmingas May 7, 2020
f878bf1
Fix pylint errors, move .py example, fix failing test
gmingas May 11, 2020
7cf2650
Add computer specs to notebook
gmingas May 11, 2020
f0e639e
Change class checks to using isinstance
gmingas May 11, 2020
4a960c3
Add more tests for stats, competence, etc and fix bug with tune flag …
gmingas May 11, 2020
08179d4
Remove duplicate sample_except()
gmingas May 18, 2020
ca169e8
Move is_mlda_base checks for reseting inside Metropolis' reset_tuning()
gmingas May 20, 2020
5bf7d25
Add DEMetropolis to notebook
gmingas May 21, 2020
ff9f92d
Add MLDA groundwater flow notebook which uses blocked samplers only
gmingas May 21, 2020
3db97ae
Add comparison with DEMCMC-Z amd longer runs for convergence in examp…
gmingas Jun 19, 2020
e3ab26e
Add separate subsampling rates
gmingas Jun 23, 2020
847938c
Edit docstring
gmingas Jun 23, 2020
d5ae292
Fix handling of one integer for subsampling rate
gmingas Jun 23, 2020
a693dbf
Add tests and change subsampling argument name in examples/tests
gmingas Jun 23, 2020
74cdf2a
Add notebook with extra benchmarks and tuning demo
gmingas Jun 23, 2020
dfa357f
Change subsampling rate to rates in notebook examples (including new …
gmingas Jun 23, 2020
86e7855
Do not count stuck proposals from lower chain as accepted
gmingas Jul 16, 2020
3c6e516
Convert base_scaling stats to one stat of type object, modify tests f…
gmingas Jul 16, 2020
fb46e00
Fix pm.DensityDist in notebooks/scripts by replacing with pm.Potential
gmingas Jul 22, 2020
18b91c2
Move MLDA and RecursiveDAProposal classes to new mlda.py file, add a …
gmingas Aug 11, 2020
b439653
Remove MLDA notebooks and .py example script, remove code that uses f…
gmingas Aug 12, 2020
1213c09
Blacken MLDA code and tests, separate MLDA type tests from other meth…
gmingas Aug 13, 2020
3f42b56
Add simple linear regression notebook which can serve as MLDA startin…
gmingas Aug 5, 2020
1ceb4bd
Modify some comments in the simple notebook and re-run
gmingas Aug 17, 2020
2aa19cc
Add typing to mlda.py
gmingas Aug 17, 2020
562e347
Connect the two separate strings in mlda.py
gmingas Aug 18, 2020
4e9d8b3
Modify simple linear regression notebook: coarse model uses subset of…
gmingas Aug 19, 2020
3108d83
Add more comments, format using PyMC3 NB style guide (blacken, waterm…
gmingas Aug 19, 2020
f0b13da
Add simple regression notebook to table of examples
gmingas Aug 20, 2020
9125984
Add gravity surveying notebook
gmingas Sep 2, 2020
9c7b221
Add MLDA line in 3.9.x release notes
gmingas Sep 8, 2020
82307dd
Edit notebook imports to adhere to nbqa-isort rules
gmingas Sep 14, 2020
b5459c2
Add gravity notebook to table of contents
gmingas Sep 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

### New features
- `sample_posterior_predictive_w` can now feed on `xarray.Dataset` - e.g. from `InferenceData.posterior`. (see [#4042](https://github.com/pymc-devs/pymc3/pull/4042))
- Add MLDA, a new stepper for multilevel sampling. MLDA can be used when a hierarchy of approximate posteriors of varying accuracy is available, offering improved sampling efficiency especially in high-dimensional problems and/or where gradients are not available (see [#3926](https://github.com/pymc-devs/pymc3/pull/3926))


## PyMC3 3.9.3 (11 August 2020)
Expand Down
2,707 changes: 2,707 additions & 0 deletions docs/source/notebooks/MLDA_gravity_surveying.ipynb

Large diffs are not rendered by default.

636 changes: 636 additions & 0 deletions docs/source/notebooks/MLDA_simple_linear_regression.ipynb

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion docs/source/notebooks/table_of_contents_examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,7 @@ Gallery.contents = {
"GLM-hierarchical-advi-minibatch": "Variational Inference",
"ODE_with_manual_gradients": "Inference in ODE models",
"ODE_API_introduction": "Inference in ODE models",
"probabilistic_matrix_factorization": "Case Studies"
"probabilistic_matrix_factorization": "Case Studies",
"MLDA_simple_linear_regression": "MCMC",
"MLDA_gravity_surveying": "MCMC"
}
1 change: 1 addition & 0 deletions pymc3/step_methods/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from .metropolis import BinaryMetropolis
from .metropolis import BinaryGibbsMetropolis
from .metropolis import CategoricalGibbsMetropolis
from .mlda import MLDA, MetropolisMLDA, RecursiveDAProposal
from .metropolis import NormalProposal
from .metropolis import CauchyProposal
from .metropolis import LaplaceProposal
Expand Down
2 changes: 1 addition & 1 deletion pymc3/step_methods/metropolis.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def __init__(self, vars=None, S=None, proposal_dist=None, lamb=None, scaling=0.0

if S is None:
S = np.ones(model.ndim)

if proposal_dist is not None:
self.proposal_dist = proposal_dist(S)
else:
Expand Down
Loading