PyTorch code accompanying our paper on Maximum Entropy Generators for Energy-Based Models

Overview

Maximum Entropy Generators for Energy-Based Models

All experiments have tensorboard visualizations for samples / density / train curves etc.

  1. To run the toy data experiments:
python scripts/train/ebm_toy.py --dataset swissroll --save_path logs/swissroll
  1. To run the discrete mode collapse experiment:
python scripts/train/ebm_mnist.py --save_path logs/mnist_3 --n_stack 3

This requires the pretrained mnist classifier:

python scripts/train/mnist_classifier.py
  1. To run the CIFAR image generation experiment:
python scripts/train/ebm_cifar.py --save_path logs/cifar

To run the MCMC evalulations on CIFAR data:

python scripts/test/eval_metrics_cifar --load_path logs/cifar --n_samples 50000 --mcmc_iters 5 --temp .01

NOTE: This requires cloning the TTUR repo in the current working directory (https://github.com/bioinf-jku/TTUR).

  1. To run the CelebA image generation experiments:
python scripts/train/ebm_celeba.py --save_path logs/celeba

NOTE: Results are subject to PyTorch version. I have already noticed variance in quantitative numbers with PyTorch version upgrades.

Comments
  • FileNotFoundError: [Errno 2] No such file or directory: '/Tmp/kumarrit/cifar_samples'

    FileNotFoundError: [Errno 2] No such file or directory: '/Tmp/kumarrit/cifar_samples'

    when I run the MCMC evalulations on CIFAR data: I got the error: FileNotFoundError: [Errno 2] No such file or directory: '/Tmp/kumarrit/cifar_samples' And I noticed that : NOTE: This requires cloning the TTUR repo in the current working directory (https://github.com/bioinf-jku/TTUR). I download the repo. But I didn't find the file. Can you show me how I can get the directory: '/Tmp/kumarrit/cifar_samples'? Look forward to you reply ! Thanks!

    opened by Dear-zhangliyuan 1
  • the problem of MCMC ?

    the problem of MCMC ?

    you use MCMC on random variable z, which means you think the energy function of z is E(G(z)), where E(x) is the energy function of x and G(z) is generator. But why?

    We have p_{\theta}(x) = e^{-E(x)}/Z is a energy distribution of x. If we transform it with x=G(z), we get p(z)=e^{-E(G(z))}/Z * abs(det(dG/dz)), where dG/dz is Jacobian of G. The result is not equal e^{-E(G(z))}/Z.

    opened by bojone 1
  • Why the MALA sampling is turned off in the training?

    Why the MALA sampling is turned off in the training?

    Hi, I find the MALA sampling is commented off here: https://github.com/ritheshkumar95/energy_based_generative_models/blob/master/scripts/train/functions.py#L10. And, I find it only shows up in the testing. So, do you mean it is not helpful during the training?

    opened by JiahaoYao 0
  • How to use MINE for estimating the KL divergence between Gaussian and Laplace distribution just like  KL(P(X)||P(Y)

    How to use MINE for estimating the KL divergence between Gaussian and Laplace distribution just like KL(P(X)||P(Y)

    HI,recently,i want to use MINE to estimate the KL between Gaussian distribution and Laplace distribution。I have noted that how to input when i want to estimate KL(P(XY)||P(X)P(Y))。But I dont know how to input when i want to estimate KL(P(X)||P(Y)),i chosen Gaussian distribution and Laplace distribution,just got N samples from them,do i need to shuffle their sample values?

    opened by 1032864600 0
  • how can we explain GAN works without I(X,Z) term?

    how can we explain GAN works without I(X,Z) term?

    compared with wgan-gp or wgan-div, your new GAN has an additional I(X,Z) term on generator loss. This term may prevent generator from mode collapse.

    As we known, wgan-gp or wgan-div can be trained successfully without I(X,Z). But as your derivation in your paper, I(X,Z) is indispensable.

    Therefore, how can we understand the success of wgan-gp or wgan-div under your framework ?

    opened by bojone 2
  • why not use KL divergence to estimate mutual information

    why not use KL divergence to estimate mutual information

    As we know I(X,Z) = KL(p(x,z)||p(x)p(z)). So why do you estimate mutual information by JSD rather than KL maximization?

    f-GAN also gives us KL(p(x)||q(x)) = max_T E_{x~p(x)} [T(x)] - E_{x\sim q(x)} [e^{T(x)-1}] I think it is a more natural and more reasonable choice than JSD ?

    opened by bojone 6
  • how if we use hinge loss as EnergyModel loss?

    how if we use hinge loss as EnergyModel loss?

    Good job! But I have some problems:

    1. how if we use hinge loss as EnergyModel loss? Gradient penalty is actually good but we know with gradient penalty is slow.

    2. Can you show more final demo pictures in github? I really want to see the whole results on cifar10 and celeba.

    thanks for such a good job.

    opened by bojone 3
Owner
Rithesh Kumar
AI Researcher @ Descript. Formerly Mila | MSR Montreal | Lyrebird
Rithesh Kumar
Predicting path with preference based on user demonstration using Maximum Entropy Deep Inverse Reinforcement Learning in a continuous environment

Preference-Planning-Deep-IRL Introduction Check my portfolio post Dependencies Gym stable-baselines3 PyTorch Usage Take Demonstration python3 record.

Tianyu Li 9 Oct 26, 2022
Softlearning is a reinforcement learning framework for training maximum entropy policies in continuous domains. Includes the official implementation of the Soft Actor-Critic algorithm.

Softlearning Softlearning is a deep reinforcement learning toolbox for training maximum entropy policies in continuous domains. The implementation is

Robotic AI & Learning Lab Berkeley 997 Dec 30, 2022
Code accompanying our paper Feature Learning in Infinite-Width Neural Networks

Empirical Experiments in "Feature Learning in Infinite-width Neural Networks" This repo contains code to replicate our experiments (Word2Vec, MAML) in

Edward Hu 37 Dec 14, 2022
Pytorch implementation of the paper Progressive Growing of Points with Tree-structured Generators (BMVC 2021)

PGpoints Pytorch implementation of the paper Progressive Growing of Points with Tree-structured Generators (BMVC 2021) Hyeontae Son, Young Min Kim Pre

Hyeontae Son 9 Jun 6, 2022
Code for ICCV 2021 paper: ARAPReg: An As-Rigid-As Possible Regularization Loss for Learning Deformable Shape Generators..

ARAPReg Code for ICCV 2021 paper: ARAPReg: An As-Rigid-As Possible Regularization Loss for Learning Deformable Shape Generators.. Installation The cod

Bo Sun 132 Nov 28, 2022
Official implementation of the paper Image Generators with Conditionally-Independent Pixel Synthesis https://arxiv.org/abs/2011.13775

CIPS -- Official Pytorch Implementation of the paper Image Generators with Conditionally-Independent Pixel Synthesis Requirements pip install -r requi

Multimodal Lab @ Samsung AI Center Moscow 201 Dec 21, 2022
the code for paper "Energy-Based Open-World Uncertainty Modeling for Confidence Calibration"

EOW-Softmax This code is for the paper "Energy-Based Open-World Uncertainty Modeling for Confidence Calibration". Accepted by ICCV21. Usage Commnd exa

Yezhen Wang 36 Dec 2, 2022
PyTorch code for SENTRY: Selective Entropy Optimization via Committee Consistency for Unsupervised DA

PyTorch Code for SENTRY: Selective Entropy Optimization via Committee Consistency for Unsupervised Domain Adaptation Viraj Prabhu, Shivam Khare, Deeks

Viraj Prabhu 46 Dec 24, 2022
💡 Learnergy is a Python library for energy-based machine learning models.

Learnergy: Energy-based Machine Learners Welcome to Learnergy. Did you ever reach a bottleneck in your computational experiments? Are you tired of imp

Gustavo Rosa 57 Nov 17, 2022
Learning Energy-Based Models by Diffusion Recovery Likelihood

Learning Energy-Based Models by Diffusion Recovery Likelihood Ruiqi Gao, Yang Song, Ben Poole, Ying Nian Wu, Diederik P. Kingma Paper: https://arxiv.o

Ruiqi Gao 41 Nov 22, 2022
Implementation of accepted AAAI 2021 paper: Deep Unsupervised Image Hashing by Maximizing Bit Entropy

Deep Unsupervised Image Hashing by Maximizing Bit Entropy This is the PyTorch implementation of accepted AAAI 2021 paper: Deep Unsupervised Image Hash

null 62 Dec 30, 2022
Official implementation of "GS-WGAN: A Gradient-Sanitized Approach for Learning Differentially Private Generators" (NeurIPS 2020)

GS-WGAN This repository contains the implementation for GS-WGAN: A Gradient-Sanitized Approach for Learning Differentially Private Generators (NeurIPS

null 46 Nov 9, 2022
[ICLR 2022] Pretraining Text Encoders with Adversarial Mixture of Training Signal Generators

AMOS This repository contains the scripts for fine-tuning AMOS pretrained models on GLUE and SQuAD 2.0 benchmarks. Paper: Pretraining Text Encoders wi

Microsoft 22 Sep 15, 2022
Open source repository for the code accompanying the paper 'Non-Rigid Neural Radiance Fields Reconstruction and Novel View Synthesis of a Deforming Scene from Monocular Video'.

Non-Rigid Neural Radiance Fields This is the official repository for the project "Non-Rigid Neural Radiance Fields: Reconstruction and Novel View Synt

Facebook Research 296 Dec 29, 2022
Official repository with code and data accompanying the NAACL 2021 paper "Hurdles to Progress in Long-form Question Answering" (https://arxiv.org/abs/2103.06332).

Hurdles to Progress in Long-form Question Answering This repository contains the official scripts and datasets accompanying our NAACL 2021 paper, "Hur

Kalpesh Krishna 41 Nov 8, 2022
Code accompanying the paper "Wasserstein GAN"

Wasserstein GAN Code accompanying the paper "Wasserstein GAN" A few notes The first time running on the LSUN dataset it can take a long time (up to an

null 3.1k Jan 1, 2023
Code accompanying the paper "How Tight Can PAC-Bayes be in the Small Data Regime?"

How Tight Can PAC-Bayes be in the Small Data Regime? This is the code to reproduce all experiments for the following paper: @inproceedings{Foong:2021:

null 5 Dec 21, 2021
Code repository accompanying the paper "On Adversarial Robustness: A Neural Architecture Search perspective"

On Adversarial Robustness: A Neural Architecture Search perspective Preparation: Clone the repository: https://github.com/tdchaitanya/nas-robustness.g

Chaitanya Devaguptapu 4 Nov 10, 2022
PyTorch implementation of our Adam-NSCL algorithm from our CVPR2021 (oral) paper "Training Networks in Null Space for Continual Learning"

Adam-NSCL This is a PyTorch implementation of Adam-NSCL algorithm for continual learning from our CVPR2021 (oral) paper: Title: Training Networks in N

Shipeng Wang 34 Dec 21, 2022