normalizing_flows  by kamenbliznashki

PyTorch for density estimation research

created 6 years ago
627 stars

Top 53.6% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides PyTorch implementations of several normalizing flow models for density estimation, including BNAF, Glow, MAF, RealNVP, and planar flows. It is targeted at researchers and practitioners in generative modeling and machine learning who need to experiment with or reproduce results from these advanced density estimation techniques. The benefit is a unified codebase for exploring and comparing different normalizing flow architectures.

How It Works

The project reimplements key normalizing flow architectures, each designed for density estimation. BNAF and MAF leverage autoregressive properties for efficient computation, while Glow utilizes invertible 1x1 convolutions. RealNVP employs coupling layers for invertibility. These methods transform a simple base distribution (e.g., Gaussian) into a complex target distribution through a series of invertible transformations, allowing for exact likelihood computation.

Quick Start & Requirements

  • Install: pip install -r requirements.txt (specific requirements vary per model).
  • Prerequisites: Python 3.6+, PyTorch 1.0+, NumPy, Matplotlib, TensorBoardX. Some datasets require Pandas, Scikit-learn, and h5py. CUDA is recommended for training.
  • Usage: Scripts like bnaf.py, glow.py, maf.py, and planar_flow.py are used for training, plotting, evaluation, and generation.
  • Resources: Links to official implementations and dataset download instructions are provided.

Highlighted Details

  • Implements Block Neural Autoregressive Flow (BNAF), Glow, Masked Autoregressive Flow (MAF), RealNVP, and planar flows.
  • Includes results and benchmarks on toy datasets, energy potentials, CelebA, MNIST, and UCI datasets.
  • Demonstrates attribute manipulation in Glow for generative tasks.
  • Provides scripts for training, evaluation, and sample generation for each model.

Maintenance & Community

The repository appears to be a personal project, with no explicit mention of active maintenance, community channels (like Discord/Slack), or a roadmap.

Licensing & Compatibility

The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The project relies on older versions of PyTorch (1.0) and Python (3.6), which may pose compatibility issues with current environments. The lack of explicit licensing and community support could be a concern for long-term adoption.

Health Check
Last commit

4 years ago

Responsiveness

1+ week

Pull Requests (30d)
0
Issues (30d)
0
Star History
9 stars in the last 90 days

Explore Similar Projects

Starred by Lilian Weng Lilian Weng(Cofounder of Thinking Machines Lab), Patrick Kidger Patrick Kidger(Core Contributor to JAX ecosystem), and
4 more.

glow by openai

0.1%
3k
Generative flow research paper code
created 7 years ago
updated 1 year ago
Feedback? Help us improve.