pints
pints copied to clipboard
Add SMC sampler
~Still a work in progress, just need to update it to re-use a single chain and then it should be fine~
~Looks to be working now~
Fixes #120
Codecov Report
Merging #749 into master will not change coverage. The diff coverage is
100%
.
@@ Coverage Diff @@
## master #749 +/- ##
======================================
Coverage 100% 100%
======================================
Files 52 54 +2
Lines 5022 5365 +343
======================================
+ Hits 5022 5365 +343
Impacted Files | Coverage Δ | |
---|---|---|
pints/_sequential/__init__.py | 100% <100%> (ø) |
|
pints/_sequential/_SMC.py | 100% <100%> (ø) |
|
pints/_nested/_rejection.py | 100% <100%> (ø) |
:arrow_up: |
pints/_mcmc/_adaptive_covariance.py | 100% <100%> (ø) |
:arrow_up: |
pints/_nested/_ellipsoid.py | 100% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 9dd19c6...b6e9361. Read the comment docs.
Had a chat with @ben18785 , decided to do it in chunks, i.e. evaluate n_particles
in blocks of n_processes
, then adapting in between
@ben18785 The first example works the same as the old now, but the second will need some tuning I think. Can you have a play around with it?
If all went well - the main difference between your code and my non-parallelised code is that your code assumed a very wide uniform log prior if the user didn't specify one, but didn't use this prior for initialisation (for which it used a multivariate gaussian instead, for some reason).
If you have time, please play around with the 2nd example and have a look at the code.
Have also implemented parallelisation by doing batches of samples, as discussed. This reduces the performance somewhat. (On toy problems, it also slows everything down, because the overhead is much larger than the evaluation time of a single loglikelihood)
Looking forward to merging this!
There were some conflicts between this branch and master, so merged master into this branch, which is apparently the done thing in these situations! Part of merging master into this branch was resolving merge conflicts. After that, it should be easy to merge this branch into master, because they're the same!
Tests & docs etc. in too now, have a look if you think the results are right @ben18785 :D :D
@ben18785 is this still something we need?
@ben18785 can this one go now that SMC is in via another PR?
Closing as this never ended up working!