Skip to main content

Compute Renyi Kernel Entropy scores (RKE-MC and RRKE) for two sets of vectors.

Project description

RKE score

Paper: An Information-Theoretic Evaluation of Generative Models in Learning Multi-modal Distributions

Mohammad Jalai 1*, Cheuk Ting Li 2, Farzan Farnia 2

1 Isfahan University of Technology (IUT), 2 The Chinese University of Hong Kong (CUHK)

* Work done during an internship at CUHK

1. Background

Abstract

The evaluation of generative models has received significant attention in the machine learning community. When applied to a multi-modal distribution which is common among image datasets, an intuitive evaluation criterion is the number of modes captured by the generative model. While several scores have been proposed to evaluate the quality and diversity of a model's generated data, the correspondence between existing scores and the number of modes in the distribution is unclear. In this work, we propose an information-theoretic diversity evaluation method for multi-modal underlying distributions. We define the R'enyi Kernel Entropy (RKE) as an evaluation score based on quantum information theory to measure the number of modes in generated samples. To interpret the proposed evaluation method, we show that the RKE score can output the number of modes of a mixture of sub-Gaussian components. We also prove estimation error bounds for estimating the RKE score from limited data, suggesting a fast convergence of the empirical RKE score to the score for the underlying data distribution. Utilizing the RKE score, we conduct an extensive evaluation of state-of-the-art generative models over standard image datasets. The numerical results indicate that while the recent algorithms for training generative models manage to improve the mode-based diversity over the earlier architectures, they remain incapable of capturing the full diversity of real data. Our empirical results provide a ranking of widely-used generative models based on the RKE score of their generated samples.

R'enyi Kernel Entropy Mode Count (RKE) and Relative R'enyi Kernel Entropy (RRKE)

Formulation

Toy example: Gaussian Distributions

Evaluation of Generative Models

2. Usage

Installation

Using PIP

pip install rke

Manually

git clone https://github.com/mjalali/renyi-kernel-entropy-score
python setup.py install

Example

import numpy as np
from rke_score import RKE


num_real_samples = num_fake_samples = 10000
feature_dim = 1000

real_features = np.random.normal(loc=0.0, scale=1.0,
                                 size=[num_real_samples, feature_dim])

fake_features = np.random.normal(loc=0.0, scale=1.0,
                                 size=[num_fake_samples, feature_dim])

kernel = RKE(kernel_bandwidth=[0.2, 0.3, 0.4])


print(kernel.compute_rke_mc)
print(kernel.compute_rrke)

Guide to evaluate your model

You can evaluate your model using different feature extractors (mostly used: inceptionV3)

3. Cite our work

@inproceedings{
    jalali2023rke,
    title={An Information-Theoretic Evaluation of Generative Models in Learning Multi-modal Distributions},
    author={Mohammad Jalali and Cheuk Ting Li and Farzan Farnia},
    booktitle={Thirty-seventh Conference on Neural Information Processing Systems},
    year={2023},
    url={https://openreview.net/forum?id=PdZhf6PiAb}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rke-score-0.0.6.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rke_score-0.0.6-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file rke-score-0.0.6.tar.gz.

File metadata

  • Download URL: rke-score-0.0.6.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for rke-score-0.0.6.tar.gz
Algorithm Hash digest
SHA256 1fac422169a5d9033cf68cc79dda527612353412325a398f4a0e789d63d57115
MD5 9ff516c65495964e51b1ad3730a0cc49
BLAKE2b-256 fee19cfd9509482b20487b4cb2c6d01b63007eb90eef50d64f5b69dc6a4e0825

See more details on using hashes here.

File details

Details for the file rke_score-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: rke_score-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for rke_score-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2fc610c6d00cc09ca98c36639f34856766b4ea97f65c1a99cdd4ee9fa31a9869
MD5 4a46ebd5f2fa8bc94c5dfb77dc5da05d
BLAKE2b-256 e30bc1c48201ece93ce56eab40db47aab41c519d0a39b230055b7f1019da7c9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page