-
Notifications
You must be signed in to change notification settings - Fork 11
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
Particle Gibbs with ancestor resampling #32
Conversation
Pull Request Test Coverage Report for Build 2024648543Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Codecov Report
@@ Coverage Diff @@
## master #32 +/- ##
==========================================
+ Coverage 61.26% 64.69% +3.42%
==========================================
Files 6 7 +1
Lines 426 507 +81
==========================================
+ Hits 261 328 +67
- Misses 165 179 +14
Continue to review full report at Codecov.
|
src/pgas.jl
Outdated
end | ||
|
||
function fork(trace::SSMTrace, isref::Bool) | ||
model = deepcopy(trace.f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this might become memory intensive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is the main issue with this implementation, we keep copying state vectors around which will probably be quite heavy for long time series
@FredericWantiez, if you can push your local changes, I’ll take a look later this week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks, @FredericWantiez - very good work. I left some minor comments below.
AdvancedPS.initialization(model::NonLinearTimeSeries) = f₀(model) | ||
AdvancedPS.transition(model::NonLinearTimeSeries, state, step) = f(model, state, step) | ||
function AdvancedPS.observation(model::NonLinearTimeSeries, state, step) | ||
return logpdf(g(model, state, step), y[step]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a typo here? It does not seem y
is in the arguments.
return logpdf(g(model, state, step), y[step]) | |
return logpdf(g(model, state, step), y[step]) |
Many thanks, @FredericWantiez - excellent work! Only a few minor comment/clarification questions remain. Once fixed, we should be ready to go. |
Adding ancestor resampling for state space models, this works I think but it's mostly to discuss the API for the model/sampler. In this I assume something like:
Edit
The model API changed slightly to make the step and state explicit in the
initialization/observation
functions (needed for the ancestor sampling step)