AdvancedPS.jl icon indicating copy to clipboard operation
AdvancedPS.jl copied to clipboard

`PGAS` requires an empty state vector to start with

Open FredericWantiez opened this issue 2 years ago • 1 comments

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 avatar Sep 18 '23 16:09 FredericWantiez

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

FredericWantiez avatar Sep 18 '23 16:09 FredericWantiez