All Projects → msmsajjadi → precision-recall-distributions

msmsajjadi / precision-recall-distributions

Licence: Apache-2.0 license
Assessing Generative Models via Precision and Recall (official repository)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to precision-recall-distributions

Tensorflow Generative Model Collections
Collection of generative models in Tensorflow
Stars: ✭ 3,785 (+4631.25%)
Mutual labels:  vae, variational-autoencoder, generative-models
Video prediction
Stochastic Adversarial Video Prediction
Stars: ✭ 247 (+208.75%)
Mutual labels:  generative-adversarial-network, vae, variational-autoencoder
Generative Continual Learning
No description or website provided.
Stars: ✭ 51 (-36.25%)
Mutual labels:  generative-adversarial-network, variational-autoencoder, generative-models
Pytorch Rl
This repository contains model-free deep reinforcement learning algorithms implemented in Pytorch
Stars: ✭ 394 (+392.5%)
Mutual labels:  generative-adversarial-network, vae, variational-autoencoder
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 (+67.5%)
Mutual labels:  generative-adversarial-network, vae, variational-autoencoder
benchmark VAE
Unifying Variational Autoencoder (VAE) implementations in Pytorch (NeurIPS 2022)
Stars: ✭ 1,211 (+1413.75%)
Mutual labels:  vae, variational-autoencoder
All About The Gan
All About the GANs(Generative Adversarial Networks) - Summarized lists for GAN
Stars: ✭ 630 (+687.5%)
Mutual labels:  generative-adversarial-network, adversarial-networks
vae-concrete
Keras implementation of a Variational Auto Encoder with a Concrete Latent Distribution
Stars: ✭ 51 (-36.25%)
Mutual labels:  vae, variational-autoencoder
soft-intro-vae-pytorch
[CVPR 2021 Oral] Official PyTorch implementation of Soft-IntroVAE from the paper "Soft-IntroVAE: Analyzing and Improving Introspective Variational Autoencoders"
Stars: ✭ 170 (+112.5%)
Mutual labels:  vae, variational-autoencoder
Textbox
TextBox is an open-source library for building text generation system.
Stars: ✭ 257 (+221.25%)
Mutual labels:  generative-adversarial-network, variational-autoencoder
Deep Generative Models
Deep generative models implemented with TensorFlow 2.0: eg. Restricted Boltzmann Machine (RBM), Deep Belief Network (DBN), Deep Boltzmann Machine (DBM), Convolutional Variational Auto-Encoder (CVAE), Convolutional Generative Adversarial Network (CGAN)
Stars: ✭ 34 (-57.5%)
Mutual labels:  generative-adversarial-network, variational-autoencoder
Rectorch
rectorch is a pytorch-based framework for state-of-the-art top-N recommendation
Stars: ✭ 121 (+51.25%)
Mutual labels:  generative-adversarial-network, variational-autoencoder
Generative Models
Annotated, understandable, and visually interpretable PyTorch implementations of: VAE, BIRVAE, NSGAN, MMGAN, WGAN, WGANGP, LSGAN, DRAGAN, BEGAN, RaGAN, InfoGAN, fGAN, FisherGAN
Stars: ✭ 438 (+447.5%)
Mutual labels:  generative-adversarial-network, vae
Adversarial video generation
A TensorFlow Implementation of "Deep Multi-Scale Video Prediction Beyond Mean Square Error" by Mathieu, Couprie & LeCun.
Stars: ✭ 662 (+727.5%)
Mutual labels:  generative-adversarial-network, adversarial-networks
Generative models tutorial with demo
Generative Models Tutorial with Demo: Bayesian Classifier Sampling, Variational Auto Encoder (VAE), Generative Adversial Networks (GANs), Popular GANs Architectures, Auto-Regressive Models, Important Generative Model Papers, Courses, etc..
Stars: ✭ 276 (+245%)
Mutual labels:  generative-adversarial-network, variational-autoencoder
Repo 2017
Python codes in Machine Learning, NLP, Deep Learning and Reinforcement Learning with Keras and Theano
Stars: ✭ 1,123 (+1303.75%)
Mutual labels:  generative-adversarial-network, variational-autoencoder
Focal Frequency Loss
Focal Frequency Loss for Generative Models
Stars: ✭ 141 (+76.25%)
Mutual labels:  generative-adversarial-network, variational-autoencoder
PySODEvalToolkit
PySODEvalToolkit: A Python-based Evaluation Toolbox for Salient Object Detection and Camouflaged Object Detection
Stars: ✭ 59 (-26.25%)
Mutual labels:  evaluation, evaluation-metrics
tt-vae-gan
Timbre transfer with variational autoencoding and cycle-consistent adversarial networks. Able to transfer the timbre of an audio source to that of another.
Stars: ✭ 37 (-53.75%)
Mutual labels:  generative-adversarial-network, variational-autoencoder
private-data-generation
A toolbox for differentially private data generation
Stars: ✭ 80 (+0%)
Mutual labels:  generative-adversarial-network, generative-models

Assessing Generative Models via Precision and Recall

Official code for Assessing Generative Models via Precision and Recall by Mehdi S. M. Sajjadi, Olivier Bachem, Mario Lucic, Olivier Bousquet, and Sylvain Gelly, presented at NeurIPS 2018. The poster can be downloaded here.

Usage

Requirements

A list of required packages is provided in requirements.txt and may be installed by running:

pip install -r requirements.txt

If the embedding is computed manually, a minimal set of required packages may be used, see requirements_minimal.txt.

Automatic: Compute PRD for folders of images on disk

Note that a GPU will significantly speed up the computation of the Inception embeddings, consider installing pip install tensorflow-gpu.

Example: you have a folder of images from your true distribution (e.g., ~/real_images/) and any number of folders of generated images (e.g., ~/generated_images_1/ and ~/generated_images_2/). Note that the number of images in each folder needs to be the same.

  1. Download the pre-trained inception network from here and place it somewhere, e.g. /tmp/prd_cache/inception.pb (Alternate link here. Note that this file needs to be unpacked.)
  2. In a shell, cd to the repository directory and run
python prd_from_image_folders.py --inception_path /tmp/prd_cache/inception.pb --reference_dir ~/real_images/ --eval_dirs ~/generated_images_1/ ~/generated_images_2/ --eval_labels model_1 model_2

For further customization, run ./prd_from_image_folders.py -h to see the list of available options.

Manual: Compute PRD from any embedding

Example: you want to compare the precision and recall of a pair of generative models in some feature embedding to your liking (e.g., Inception activations).

  1. Take your test dataset and generate the same number of data points from each of your generative models to be evaluated.
  2. Compute feature embeddings of both real and generated datasets, e.g. feats_real, feats_gen_1 and feats_gen_2 as numpy arrays each of shape [number_of_data_points, feature_dimensions].
  3. In python, run the following code:
import prd
prd_data_1 = prd.compute_prd_from_embedding(feats_real, feats_gen_1)
prd_data_2 = prd.compute_prd_from_embedding(feats_real, feats_gen_2)
prd.plot([prd_data_1, prd_data_2], ['model_1', 'model_2'])

BibTex citation

@inproceedings{precision_recall_distributions,
  title     = {{Assessing Generative Models via Precision and Recall}},
  author    = {Sajjadi, Mehdi~S.~M. and Bachem, Olivier and Lu{\v c}i{\'c}, Mario and Bousquet, Olivier and Gelly, Sylvain},
  booktitle = {{Advances in Neural Information Processing Systems (NeurIPS)}},
  year      = {2018}}

Further information

External copyright for: prd_score.py prd_score_test.py inception_network.py
Copyright for remaining files: Mehdi S. M. Sajjadi

License for all files: Apache License 2.0

For any questions, comments or help to get it to run, please don't hesitate to mail us: [email protected]

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].