Git Product home page Git Product logo

dmm's Introduction

Deep Markov Models

Overview

This repository contains theano code for implementing Deep Markov Models. The code is documented and should be easy to modify for your own applications.

Deep Markov Model

The code uses variational inference during learning to maximize the likelihood of the observed data:

Evidence Lower Bound

  • Generative Model
    • The figure depicts a state space model for time-varying data.
    • The latent variables z1...zT and the observations x1...xT together describe the generative process for the data.
    • The emission p(x_t|z_t) and transition functions p(z_t|z_{t-1}) are parameterized by deep neural networks
  • Inference Model
    • The function q(z1..zT | x1...xT) represents the inference network
    • This is a parametric approximation to the variational posterior used for learning at training time and for inference at test time.

Requirements

This package has the following requirements:

  • python2.7
  • Theano
    • Used for automatic differentiation
  • theanomodels
    • Wrapper around theano that takes care of bookkeeping, saving/loading models etc. Clone the github repository and add its location to the PYTHONPATH environment variable so that it is accessible by python.
  • An NVIDIA GPU w/ atleast 6G of memory is recommended.

Optional

I used the following ~/.theanorc configuration file:

[global]
floatX=float32

[mode]=FAST_RUN

[nvcc]
fastmath=True

[cuda]
root=/usr/local/cuda

You can change whether the model is run on the GPU or CPU by modifying the THEANO_FLAGS. See here for documentation.

Folders

  • Model Code: model_th: This folder contains raw theano code implementing the model. See the folder for details on how the DMM was implementation and pointers to portions of the code.
  • Datasets: dmm_data: This folder contains code to load the polyphonic music data and a synthetic dataset. Add or change code in load.py(dmm_data/load.py) to run the model on your own data.
  • Tutorials: ipynb: This folder contains some IPython notebooks with examples on loading and running the model on your own data.
  • Hyperparameters: parse_args.py: This file contains hyperparameters used by the model. Run python parse_args.py -h for an explanation of what the various choices of parameters change in the generative model and inference network.
  • Modeling Polyphonic Music: expt: Experimental setup for running the DMM on the polyphonic music dataset
  • Template Folder for Training DMMs: expt_template : Experimental setup for running the DMM on synthetic real-valued observations.

Running the model on your data

  • A general purpose tutorial for setting up and running the model can be found in the IPython Notebooks.
  • The code currently supports binary and real-valued data. An example of modeling binary data may be found in expt/.

References:

Please cite the following paper if you find the code useful in your research:

@inproceedings{krishnan2016structured,
  title={Structured Inference Networks for Nonlinear State Space Models},
  author={Krishnan, Rahul G and Shalit, Uri and Sontag, David},
  booktitle={AAAI},
  year={2017}
}

This paper subsumes the work in : [Deep Kalman Filters] (https://arxiv.org/abs/1511.05121)

dmm's People

Contributors

rahulk90 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

dmm's Issues

Tailoring the load.py for using my own data

Hi
I have a time series data almost similar to jsb_chorales data. The only difference is that for each timestep jsb_chorales has 88 binary values while I have one continuous value so essentially my one sequence can be represented in a 1-d array. I would like to train a dmm on my data.

I tried to understand the simulateLinearData but I couldn't entirely comprehend the code; mainly because of this line:
zlist= [np.copy(z)[:,None,:]]
I am unable to visualize it.

Where is the utils file?

Hello, I am a graduate student at Harvard. I read your paper on Deep Kalman Filters, and I would like to use this model in my final project on cryptocurrency price prediction. When I tried to modify your code, I found that you imported the utils module in almost every python file. However, I cannot find the utils.py file in the dmm directory. It would be great if you could help me find the utils file. Appreciate your help!

Utils folder is missing can you please help @rahulk90

Also datasets folder also missing

from dmm_data.load import load
File "/home/dinesh/Downloads/latest_downloads/dmm-master/dmm_data/load.py", line 1, in
from datasets.load import loadDataset
ImportError: No module named datasets.load

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.