-
Notifications
You must be signed in to change notification settings - Fork 7
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
SMC + FIVO implementation #16
base: main
Are you sure you want to change the base?
Conversation
… is resolved by reducing the emission covariance, which suggests that maybe it isnt actually a shift by one, but is a shift by some parameteric amount) and why the evidence approximations converge to the wrong value
… i expected though. it consistently overestimates the evidence for higher initial and emission covariances, which is kind of weird. but squashing these down and increasing the number of particles and the evidence approximations converge.
…y to present some of the analysis
…lotting code in here for the time being.
…t does appear to work though.
…he functions so that it can be notebook-ized and does not require duplicating a ton of code
…dity that the bound with proposals cant become tight. '
Unit Test Results 1 files ± 0 1 suites ±0 10m 16s ⏱️ - 20m 47s Results for commit 0111b9e. ± Comparison against base commit d84b3fe. This pull request removes 72 and adds 38 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
…est script. also added the flexibility for smc posterior to handle states without a latent dimension. also added some of the infrastructure for using arbitrary pytrees in the proposal. i figure that if this is the case then the user has created the _front-end_ for handling such a pytree as output
…machines, so this will need disabling
Coolio, so, I've added some extra tests (FIVO and SMC in some discrete models), and I've fixed up some of the interface and tools stuff Collin and I spoke about. Holla and let me know :) |
… a couple more tests/checks
Main components:
ssm -> inference -> smc.py
.SMCPosterior
that contains all sweep information.vmap
ed pretty easily to do repeated sweeps or over different trials.ssm -> notebooks -> smc-lds.ipynb
tests -> inference -> smc.py
@PyTest.mark.slow
)ssm -> inference -> conditional_generators.py
contains a template implementation for a flexible implementations of conditional distributions.build_independent_gaussian_generator
which then builds alinen
neural network module with the prescribed trunk function, and mean and variance head functions.ssm -> inference -> proposals.py
then wraps a call to a conditional generator with the prescribed trunk function, and mean and variance head functions, and also contains functions for formatting the input and output to the proposal. These input and output wrappers would need to be changed for different proposal structures or input templates.proposal_type = 'INDEPENDENT'
), there must be as many proposals as there are time steps, and then the timestep indexes the proposal to use.ssm -> inference -> fivo.py
contains some helper functions for running FIVO on a model.ssm-> notebooks -> fivo-lds.ipynb
.._parameters
paradigm. Using boilerplate code this will capture the default calling arguments when the model is initialised. This then allows for a shallow tree-flatten and un-flatten to be performed, but using the named and interpretable calling arguments.._parameters
, or inject the values into a new instantiation of the model.NotImplementedError
).utils.py
and started a utility file for neural networks stuffnn_util.py
.Obviously the FIVO code only works for Gaussian LDS's at the moment. The SMC code should work for everything. There are only independent Gaussian proposals defined at the moment, we should look to add more types of proposal.
I am reasonably confident in this current implementation. But we should sit down and do as thorough-er code review as you like.
A