Open mhauru opened 1 month ago
@yebai should also probably have a look at this :+1:
We could move this to AdvancedPS
, e.g. adding a num_produce
field to AdvancedPS.LibtaskModel
:
Each LibtaskModel
realisation corresponds to a particle / VarInfo
.
cc @FredericWantiez @willtebbutt
@mhauru, do you want to try this? I'm happy to help you through the process if you have any questions.
For reference, the only place that we use the num_produce
field is below:
which is called by a function in Turing,
Particle MCMC samplers use this to remove obsolete random variables in VarInfo
after a particle is copied/forked (as part of the resampling step in particle filtering algorithms).
Can do. Will take me a moment though, I'll have to start by reading some wikipedia to get a basic idea of what particle MCMC does.
This is a feature of
VarInfo
that's only used by particle samplers. Having it stored inVarInfo
doesn't feel like the right place, and we would like to get rid of it when we refactorVarInfo
/SimpleVarInfo
. However, having the sampler keep track of it is apparently not easy either, and might require changes to how some contexts work around samplers. We could also drop it, but that would mean losing existing particle sampler functionality.Discussed with @torfjelde, @sunxd3, and @willtebbutt.