All Projects → nicola-decao → Bnaf

nicola-decao / Bnaf

Licence: mit
Pytorch implementation of Block Neural Autoregressive Flow

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Bnaf

Deep Learning With Python
Example projects I completed to understand Deep Learning techniques with Tensorflow. Please note that I do no longer maintain this repository.
Stars: ✭ 134 (-2.9%)
Mutual labels:  neural-networks, variational-autoencoder
Smrt
Handle class imbalance intelligently by using variational auto-encoders to generate synthetic observations of your minority class.
Stars: ✭ 102 (-26.09%)
Mutual labels:  neural-networks, variational-autoencoder
Neurec
Next RecSys Library
Stars: ✭ 731 (+429.71%)
Mutual labels:  neural-networks, variational-autoencoder
Tybalt
Training and evaluating a variational autoencoder for pan-cancer gene expression data
Stars: ✭ 126 (-8.7%)
Mutual labels:  variational-autoencoder
Banditml
A lightweight contextual bandit & reinforcement learning library designed to be used in production Python services.
Stars: ✭ 127 (-7.97%)
Mutual labels:  neural-networks
Hep ml
Machine Learning for High Energy Physics.
Stars: ✭ 133 (-3.62%)
Mutual labels:  neural-networks
Ncrfpp
NCRF++, a Neural Sequence Labeling Toolkit. Easy use to any sequence labeling tasks (e.g. NER, POS, Segmentation). It includes character LSTM/CNN, word LSTM/CNN and softmax/CRF components.
Stars: ✭ 1,767 (+1180.43%)
Mutual labels:  neural-networks
Gon
Gradient Origin Networks - a new type of generative model that is able to quickly learn a latent representation without an encoder
Stars: ✭ 126 (-8.7%)
Mutual labels:  neural-networks
Chainer Cifar10
Various CNN models for CIFAR10 with Chainer
Stars: ✭ 134 (-2.9%)
Mutual labels:  neural-networks
Persephone
A tool for automatic phoneme transcription
Stars: ✭ 130 (-5.8%)
Mutual labels:  neural-networks
Pysnn
Efficient Spiking Neural Network framework, built on top of PyTorch for GPU acceleration
Stars: ✭ 129 (-6.52%)
Mutual labels:  neural-networks
Scarpet Nn
Tools and libraries to run neural networks in Minecraft ⛏
Stars: ✭ 129 (-6.52%)
Mutual labels:  neural-networks
Neuraldialog Larl
PyTorch implementation of latent space reinforcement learning for E2E dialog published at NAACL 2019. It is released by Tiancheng Zhao (Tony) from Dialog Research Center, LTI, CMU
Stars: ✭ 127 (-7.97%)
Mutual labels:  variational-autoencoder
Dnw
Discovering Neural Wirings (https://arxiv.org/abs/1906.00586)
Stars: ✭ 133 (-3.62%)
Mutual labels:  neural-networks
Jsnet
Javascript/WebAssembly deep learning library for MLPs and convolutional neural networks
Stars: ✭ 126 (-8.7%)
Mutual labels:  neural-networks
Ml Agents
Unity Machine Learning Agents Toolkit
Stars: ✭ 12,134 (+8692.75%)
Mutual labels:  neural-networks
Normalizing Flows
Understanding normalizing flows
Stars: ✭ 126 (-8.7%)
Mutual labels:  variational-autoencoder
Jevois
JeVois smart machine vision framework
Stars: ✭ 128 (-7.25%)
Mutual labels:  neural-networks
Robin
RObust document image BINarization
Stars: ✭ 131 (-5.07%)
Mutual labels:  neural-networks
Flowpp
Code for reproducing Flow ++ experiments
Stars: ✭ 137 (-0.72%)
Mutual labels:  neural-networks

BNAF

Pytorch implementation of Block Neural Autoregressive Flow based on our paper:

De Cao Nicola, Titov Ivan and Aziz Wilker, Block Neural Autoregressive Flow (2019)

Requirements

  • python>=3.6 (it will probably work on older versions but I have not tested on them)
  • pytorch>=1.0.0

Optional for visualization and plotting: numpy, matplotlib and tensorboardX

Structure

  • bnaf.py: Implementation of Block Neural Normalzing Flow.
  • toy2d.py: Experiments of 2d toy task (density estimation and energy matching).
  • density_estimation.py: Experiments on density estimation on real datasets.
  • optim: A custom extension of torch.optim.Adam and torch.optim.Adamax with Polyak averaging. A custom extension of torch.optim.lr_scheduler.ReduceLROnPlateau with callbacks.
  • data: Data classes to handle the real datasets.

Usage

Below, example commands are given for running experiments.

Download datasets

Run the following command to download the datasets:

./download_datasets.sh

Run 2D toy density estimation

This example runs density estimation on the 8 Gaussians dataset using 1 flow of BNAF with 2 layers and 100 hidden units (50 * 2 since the data dimensionality is 2).

python toy2d.py --dataset 8gaussians \    # which dataset to use
                --experiment density2d \  # which experiment to run
                --flows 1 \               # BNAF flows to concatenate
                --layers 2 \              # layers for each flow of BNAF
                --hidden_dim 50 \         # hidden units per dimension for each hidden layer
                --save                    # save the model after training
                --savefig                 # save the density plot on disk

Imgur

Run 2D toy energy matching

This example runs energy matching on the t4 function using 1 flow of BNAF with 2 layers and 100 hidden units (50 * 2 since the data dimensionality is 2).

python toy2d.py --dataset t4 \            # which dataset to use
                --experiment energy2d \   # which experiment to run
                --flows 1 \               # BNAF flows to concatenate
                --layers 2 \              # layers for each flow of BNAF
                --hidden_dim 50 \         # hidden units per dimension for each hidden layer
                --save                    # save the model after training
                --savefig                 # save the density plot on disk

Imgur

Run real dataset density estimation

This example runs density estimation on the MINIBOONE dataset using 5 flows of BNAF with 0 layers.

python density_estimation.py --dataset miniboone \  # which dataset to use
                             --flows 5 \            # BNAF flows to concatenate
                             --layers 0 \           # layers for each flow of BNAF
                             --hidden_dim 10 \      # hidden units per dimension for each hidden layer
                             --save                 # save the model after training

Citation

De Cao Nicola, Titov Ivan, Aziz Wilker,
Block Neural Autoregressive Flow,
35th Conference on Uncertainty in Artificial Intelligence (UAI19) (2019).

BibTeX format:

@article{bnaf19,
  title={Block Neural Autoregressive Flow},
  author={De Cao, Nicola and
          Titov, Ivan and
          Aziz, Wilker},
  journal={35th Conference on Uncertainty in Artificial Intelligence (UAI19)},
  year={2019}
}

Feedback

For questions and comments, feel free to contact Nicola De Cao.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].