Giter Club home page Giter Club logo

dynamax's People

Contributors

andrewwarrington avatar calebweinreb avatar canyon289 avatar emdupre avatar ezhang94 avatar gerdm avatar gileshd avatar jakevdp avatar jasondavies avatar karalleyna avatar kostastsa avatar matthew9671 avatar murphyk avatar partev avatar patel-zeel avatar petergchang avatar raulpl avatar schlagercollin avatar slinderman avatar xinglong-li avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dynamax's Issues

add support for MAP parameter estimation to GaussianHMM

Currently GaussianHMM.m_step computes the MLEs for mu_k, Sigma_k and the MAP estimate for the transition matrix A (the latter uses a weak regularizing Dirichlet prior). Modify this to allow for an optional Normal-Inverse-Wishart prior to be specified for p(mu_k,Sigma_k|z=k). Modify M step so EM supports MAP as well as MLE.

Also make it possible to add log prior to the log marginal likelihood so we can also compute the MAP estimate using SGD

Add a unit test to learning_test.py

cleanup HMM SGD code

Rename hmm_fit_minibatch_gradient_descent in
https://github.com/probml/ssm-jax/blob/main/ssm_jax/hmm/learning.py#L75
to be hmm_fit_sgd.
Rename emissions to be batch_emissions. Add commetn that input is (N,T)
but you take a minibatch of size (B,T) at each step.

Remove old hmm_fit_sgd.

Move permutation step in
https://github.com/probml/ssm-jax/blob/main/ssm_jax/hmm/learning.py#L93
inside of _sample_minibatches. Split the RNG key.
(Also check if B=N no need to do random permutation)
Add comment that you are sampling a random susbet of entire sequence, not time steps.

fix hmm/models.py

Currently all the HMM variants are in their own files and are not imported into models.py, so their names are not discoverable, so all HMM tests fail.

Implement UKF

Implement UKF, UK smoother, unit tests, pendulum demo.

Standard HMM m_step interface

Currently, BaseHMM.m_step and GaussianHMM.m_step have different inputs and outputs, which breaks the standard hmm_fit_em function. I suggest we standardize on,

@classmethod
def m_step(self, batch_emissions, batch_posteriors, **kwargs):
    ...
    return hmm

and

def hmm_fit_em(hmm, batch_emissions, num_iters=50, **kwargs):
    @jit
    def em_step(hmm):
        batch_posteriors, marginal_logliks = hmm.e_step(batch_emissions)
        hmm = hmm.m_step(batch_emissions, batch_posteriors, **kwargs)
        return hmm, marginal_logliks.sum(), batch_posteriors

(Separately, I'm starting to question whether m_step should be a class method. Maybe we should just embrace the objects and set their parameters within the M step, rather than returning a new object. We're already functional at level of the underlying inference code.)

blocked gibbs sampling for LGSSM as alternative to EM

Implement blocked gibbs sampling for LGSSM. Then make a GS version of this EM demo:
https://github.com/probml/ssm-jax/blob/main/ssm_jax/lgssm/demos/lgssm_learning.py

Some details can be found in this paper
A. Wills, T. B. Schön, F. Lindsten, and B. Ninness, “Estimation of Linear Systems using a Gibbs Sampler,” IFAC proc. vol., vol. 45, no. 16, pp. 203–208, Jul. 2012, doi: 10.3182/20120711-3-be-2027.00297. [Online]. Available: https://linkinghub.elsevier.com/retrieve/pii/S1474667015379520

cleanup LGSSM code

  • Extend inference_test to test lgssm_posterior_sample, lgssm_smoother and the log-likelihoods from lgssm_filter
  • Refactor kf_tracking so it works with new API, and can run in 'silent' mode (no figures)
  • Convert kf_parallel
  • Convert kf_spiral
  • convert linreg_kf
  • Create run_all_demos script to check if all demos run without errors
  • Update inference.py so the comments are correct, and filter and smoother both return a LGSSMPosterior object.

JSL demos we can ignore

add GitHub workflow

As requested by Dr. @murphyk, the following tasks are to be implemented as part of this issue.

  • run tests following wildcard *_test.py
  • check if the code is black formatted (as per the config mentioned in pyproject.toml)

Implement EKF

Implement EKF, EK smoother, unit tests, pendulum demo.

pendulum example

Please create separate demos for pendulum_ekf and pendulum_ukf for the Gaussian noise (no outliers) version of
ttps://github.com/probml/JSL/blob/main/jsl/demos/pendulum_1d.py

refactor hmm/models.py

Our hmm/models.py is getting too big. We could just use that for BaseHMM and factor out each subclass into its own file, so we would have ar_hmm.py, gaussian_hmm.py, categorical_hmm.py, poisson_hmm etc. This is more modular since we can encapsulate model-specific logic (eg M step) into separate files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.