synthval.metrics.InceptionScore#

class synthval.metrics.InceptionScore(num_splits=10)#

Class for computing the Inception Score over a set of probabilities.

The Inception Score measures the quality of images generated by generative models (such as GANs) by evaluating the entropy of predictions made by the Inception model. Higher scores correspond to generated images that are both diverse and sharp. As suggested by the authors of the reference paper, this metric should be computed over a sufficiently large number of samples (at least 50,000).

Parameters:

num_splits (int)

num_splits#

Number of splits to use for the probabilities. This is used to compute the score on different subsets of the data and obtain a more robust estimate of the score (default: 10).

Type:

int, Optional

References

Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, Xi Chen - Improved Techniques for Training GANs - Annual Conference on Neural Information Processing Systems, 2016.

calculate(probabilities_df)#

Compute the Inception Score over the provided probabilities.

The score is computed by evaluating the Kullback-Leibler (KL) divergence between the conditional class distribution for each generated image and the marginal class distribution across the dataset. The exponential of the average KL divergence is the Inception Score. The mean and standard deviation of the score are calculated over multiple splits of the data for robustness.

Parameters:

probabilities_df (pandas.DataFrame) – DataFrame containing the predicted class probabilities for each generated sample. The probabilities are typically obtained from a pre-trained Inception model.

Returns:

A numpy array containing the mean and the standard deviation of the computed Inception Scores across the splits.

Return type:

numpy.ndarray