TuringLang / AdvancedPS.jl

Implementation of advanced Sequential Monte Carlo and particle MCMC algorithms
https://turinglang.org/AdvancedPS.jl/
MIT License
55 stars 10 forks source link

`PGAS` requires an empty state vector to start with #81

Open FredericWantiez opened 9 months ago

FredericWantiez commented 9 months ago

There is an issue with the way we handle inner state container in PG and PGAS. For a model like this:

mutable struct Model 
   States::Vector{Float64}
end

PGAS would require the constructor of Model to create an empty array and the sampler would push new states / values into it. For PG, that's the opposite. We need to start with a pre-allocated array (like zeros(T, N)).

FredericWantiez commented 9 months ago

https://github.com/TuringLang/AdvancedPS.jl/pull/80#discussion_r1328727017