pints icon indicating copy to clipboard operation
pints copied to clipboard

Add SMC sampler

Open MichaelClerx opened this issue 6 years ago • 6 comments

~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

MichaelClerx avatar Feb 26 '19 11:02 MichaelClerx

Codecov Report

Merging #749 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          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.

codecov[bot] avatar Apr 23 '19 12:04 codecov[bot]

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

MichaelClerx avatar Apr 30 '19 12:04 MichaelClerx

@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!

MichaelClerx avatar May 23 '19 18:05 MichaelClerx

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!

MichaelClerx avatar May 23 '19 20:05 MichaelClerx

Tests & docs etc. in too now, have a look if you think the results are right @ben18785 :D :D

MichaelClerx avatar May 24 '19 21:05 MichaelClerx

@ben18785 is this still something we need?

MichaelClerx avatar Jul 04 '22 14:07 MichaelClerx

@ben18785 can this one go now that SMC is in via another PR?

MichaelClerx avatar Nov 09 '22 07:11 MichaelClerx

Closing as this never ended up working!

ben18785 avatar Nov 14 '23 12:11 ben18785