@@ -25,7 +25,7 @@ import Control.Monad.Bayes.Inference.MCMC (MCMCConfig (..))
2525import Control.Monad.Bayes.Inference.SMC
2626import Control.Monad.Bayes.Population
2727 ( PopulationT ,
28- spawn ,
28+ flatten ,
2929 withParticles ,
3030 )
3131import Control.Monad.Bayes.Sequential.Coroutine as Seq
@@ -50,8 +50,8 @@ rmsmc ::
5050 PopulationT m a
5151rmsmc (MCMCConfig {.. }) (SMCConfig {.. }) =
5252 marginal
53- . S. sequentially (composeCopies numMCMCSteps mhStep . TrStat. hoist resampler) numSteps
54- . S. hoistFirst (TrStat. hoist (spawn numParticles >> ))
53+ . S. sequentially (composeCopies numMCMCSteps ( TrStat. hoist flatten . mhStep) . TrStat. hoist resampler) numSteps
54+ . S. hoistFirst (TrStat. hoist (withParticles numParticles))
5555
5656-- | Resample-move Sequential Monte Carlo with a more efficient
5757-- tracing representation.
@@ -64,7 +64,7 @@ rmsmcBasic ::
6464 PopulationT m a
6565rmsmcBasic (MCMCConfig {.. }) (SMCConfig {.. }) =
6666 TrBas. marginal
67- . S. sequentially (composeCopies numMCMCSteps TrBas. mhStep . TrBas. hoist resampler) numSteps
67+ . S. sequentially (TrBas. hoist flatten . composeCopies numMCMCSteps ( TrBas. hoist flatten . TrBas. mhStep) . TrBas. hoist resampler) numSteps
6868 . S. hoistFirst (TrBas. hoist (withParticles numParticles))
6969
7070-- | A variant of resample-move Sequential Monte Carlo
@@ -79,7 +79,7 @@ rmsmcDynamic ::
7979 PopulationT m a
8080rmsmcDynamic (MCMCConfig {.. }) (SMCConfig {.. }) =
8181 TrDyn. marginal
82- . S. sequentially (TrDyn. freeze . composeCopies numMCMCSteps TrDyn. mhStep . TrDyn. hoist resampler) numSteps
82+ . S. sequentially (TrDyn. freeze . composeCopies numMCMCSteps ( TrDyn. hoist flatten . TrDyn. mhStep) . TrDyn. hoist resampler) numSteps
8383 . S. hoistFirst (TrDyn. hoist (withParticles numParticles))
8484
8585-- | Apply a function a given number of times.
0 commit comments