Practical overview
When it fits
Use it when you want code examples for implementing and experimenting with normalizing-flow density estimators in PyTorch, and can provide the relevant datasets and training configuration.
Who it is for
- Researchers exploring neural density estimation and normalizing-flow methods.
- Python/PyTorch developers seeking example implementations for probability-modeling experiments.
- Users comparing flow methods on toy distributions, tabular datasets or documented image datasets.
Documented uses
- Train BNAF on listed two-dimensional toy datasets and plot a saved checkpoint.
- Train, evaluate and generate image samples with the Glow implementation.
- Train or evaluate MAF-family models on listed tabular datasets or MNIST.
- Inspect example density-estimation results for toy data and test energy potentials.
Requirements & limits
- The repository includes distinct scripts and workflows for BNAF, Glow and MAF rather than one unified interface.
- Glow's documented distributed-training command uses multiple GPUs; larger model configurations may need gradient checkpointing.
- MAF dataset files must be placed in
./dataor supplied throughdata_dir. - The README describes implementations and example experiments, not a hosted service or API.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Train and plot BNAF on a toy dataset
Run the documented BNAF toy-density training workflow and plot a saved checkpoint.
Before you start
- Python and the repository's PyTorch implementation.
- A choice of dataset: u1, u2, u3, u4, 8gaussians, checkerboard or 2spirals.
Steps
Run the command below with a selected
--datasetand the desired--log_interval,--n_steps,--n_hiddenand--hidden_dimvalues.python bnaf.py --trainUse
--plotwith--restore_fileset to the path of the.ptcheckpoint.
Expected outcome
The documented workflow trains BNAF on a toy density-estimation dataset and plots a saved model.
Guide limitations
- The README lists additional options, including learning rate, learning-rate decay and patience, CUDA device ID and batch size, but does not prescribe values for a new experiment.
Train and generate samples with Glow
Follow the documented Glow distributed-training and sample-generation workflow for CelebA.
Before you start
- PyTorch distributed support and a CelebA data location.
- A trained Glow checkpoint and its saved model settings for the generation stage.
Steps
Run the command below with
--nproc_per_nodeset to the number of GPUs, followed byglow.py --train --distributedand the documented dataset, data directory and model options.python -m torch.distributed.launchRun
glow.py --generatewith the checkpoint path, dataset, data directory and saved model options; set--z_stdto select a temperature, or leave it blank to generate a range.
Expected outcome
The documented stages train a Glow model and generate image samples from a checkpoint.
Guide limitations
- The README's training example uses multiple GPUs; it does not give a single-GPU version of this distributed command.
- The README notes that larger models or images may require gradient checkpointing and describes a large-model example as slow.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 8 November 2026
- Original website title
- kamenbliznashki/normalizing_flows · Official homepage title · retained in its source language

