Git Product home page Git Product logo

jam's Introduction

jAM (JAX implementation of Action Matching)

Action Matching is a method for learning the time evolution of distributions from samples. That is, suppose we observe the time evolution of some random variable $X_t$ with the density $q_t$, from $t_0$ to $t_1$. Having access to uncorrelated samples of $X_t$ (which are not a part of a single trajectory) at different points in time $t\in [t_0,t_1]$, Action Matching learns a model of the dynamics by learning how to move samples in time such that they are distributed according to $q_t$ for any $t$.

The key idea is to learn such function $s_t$ (which we parameterize with a neural network) that yields the continuity equation $$\partial_t q_t = -\nabla \cdot(q_t \nabla s_t).$$ Then the propagation of samples in time can be performed simply by simulating the corresponding ODE $$\frac{dx}{dt} = \nabla s_t(x).$$ For the method description see the Tutorials section below or the paper.

Tutorials

Method Link
Action Matching Open In Colab
Entropic (Stochastic) Action Matching Open In Colab
Unbalanced Action Matching (with reweighting) Open In Colab

Running the code

Run all the code using main.py with different config and mode.

  • config flag takes the path to the config file.
  • mode flag takes one of the following values: "train", "eval", "fid_stats". All the modes require a config file. Mind the data.uniform_dequantization flag when evaluating statistics on the dataset for FID evaluation.
  • workdir is the path to the working directory for storing states.

For instance, on the clusters with slurm, you would run the code like this inside your sbatch scripts

python main.py --config configs/am/cifar/generation.py \
               --workdir $PWD/checkpoint/${SLURM_JOB_ID} \
               --mode 'train'

jam's People

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.