Skip to content

A demo shows how to combine Langevin dynamics with score matching for generative models.

License

Notifications You must be signed in to change notification settings

enhuiz/langevin-dynamics-and-score-matching

Repository files navigation

Langevin Dynamics and Score Matching

How to?

Setup

pip install -r requirements.txt

Train

python3 main.py config/ring.yml train

This command produces the model (learnt scaled score function): ring.pth

Test

python3 main.py config/ring.yml test

This command produces a list of frames at each stage of sampling under ring/ and an animation ring.gif made from them.

Demo (with carefully tuned hyperparameters)

  • Left: sample from the real pixel distribution
  • Right: sample using Langevin dynamics based on the score function learnt via denoising score matching.

Ring

ring.gif

Waddles

waddles.gif

Stewie

stewie.gif

Reference

  • A good lecture on Langevin dynamics for sampling.
  • A recent paper combining Langevin dynamics with denosing score matching with a more complicated multi-level pertubation scheme.
  • A paper introducing the denoising score matching.

About

A demo shows how to combine Langevin dynamics with score matching for generative models.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages