-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A bit confused regarding the interface #9
Comments
Yes, the |
How do I define different SMC samplers from this that are applicable to more than a single model type? I would have imagined something like:
But if the |
Feel like the naming is a bit unfortunate here, Roughly, the way I think this could work: abstract type AbstractStateSpaceModel end
function transition!!(::AbstractStateSpaceModel) end
function emission_logdensity(::AbstractStateSpaceModel) end
function isdone(::AbstractSpaceModel) end
struct Particle{T<:AbstractStateSpaceModel}
model::T
parent::Particle{T} # Whatever datastructure the specialization needs
end
function sample(model::AbstractStateSpaceModel, ::Particle) end
struct LinearSSM{T} <: AbstractStateSpaceModel
state::T
end
function transition!!(::LinearSSM) end
... otherwise you end up having to deal with particle dynamics (copying, memory layout ...) in the model part and that doesn't feel quite right. |
Should be fixed by #16 |
I'm slightly confused as to what the intention of the interface methods are.
Take the
transition!!
method for example. IIUC this is supposed to be implemented on a per-model basis, no?But the current code seems to indicate that this method should have the signature
transition!!(rng, step, particle[, cache])
But this is completely lacking any way to dispatch on the target model.
So am I misunderstanding this? Or is the
Particle
supposed to define all the behavior (including the model)? Or is this simply a typo, and it should indeed betransition!!(rng, model, step, particle[, cache])
?
The text was updated successfully, but these errors were encountered: