Add Differentiable Particle Filter Support#1
Merged
mattlevine22 merged 9 commits intohd-UQ:dev-numpyro-apifrom Jan 23, 2026
Merged
Add Differentiable Particle Filter Support#1mattlevine22 merged 9 commits intohd-UQ:dev-numpyro-apifrom
mattlevine22 merged 9 commits intohd-UQ:dev-numpyro-apifrom
Conversation
Unit tests will fail otherwise because they compare sample paths, and each sampler will use a different key for sampling the initial state. This enforces they derive keys from the same pattern, instead.
DanWaxman
commented
Jan 15, 2026
cd_dynamax/src/continuous_discrete_nonlinear_ssm/cdnlssm_utils.py
Outdated
Show resolved
Hide resolved
cd_dynamax/src/continuous_discrete_nonlinear_ssm/cdnlssm_utils.py
Outdated
Show resolved
Hide resolved
cd_dynamax/src/continuous_discrete_nonlinear_ssm/inference_dpf.py
Outdated
Show resolved
Hide resolved
| inputs: Optional[Array] = None, | ||
| diffeqsolve_settings: Optional[dict] = None, | ||
| ) -> Tuple[Array, Array]: | ||
| """Propagate mean/covariance using chosen approximation order.""" |
Contributor
Author
There was a problem hiding this comment.
Dispatch to CDNLGSSM case if using Brownian motions, give errors otherwise.
Contributor
Author
There was a problem hiding this comment.
We don't really have a nice setup for this right now. I would propose a refactor that takes a lot of common utilities (like compute_pushforward) to SDEs.py, or something similar, though this seems out-of-scope for the current PR.
mattlevine22
approved these changes
Jan 23, 2026
Contributor
mattlevine22
left a comment
There was a problem hiding this comment.
Looks great, thanks Dan!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds differentiable particle filter support. These entail a general
ContDiscreteNonlinearSSMclass, which allows for non-Gaussian, non-linear observation processes. We include a differentiable particle filter using either "soft" or "stop gradient" resampling methods.These methods are integrated into the Lorenz-63 example notebook (the new API one), as well as a new
dpf_examples.ipynbnotebook, which shows a few examples of non-Gaussian observations (an OU-driven count process with Poisson observations, and a tracking example with bearing (S^1) and signal power (R) observations.Remaining to-dos:
Two things that could be done in a follow-up PR, IMO: