synthval.metrics.FrechetDistance#
- class synthval.metrics.FrechetDistance(eps=1e-06)#
Bases:
SimilarityMetricSimilarity Metric that computes the Frechet distance (also known as Fréchet Inception Distance) between two distributions by comparing their means and covariances.
When applied to features extracted from the last average pooling layer of the Inception model (e.g., those provided by synthval.features_extraction.InceptionExtractor), it corresponds to the standard Frechet Inception Distance.
- Parameters:
eps (float)
- eps#
Small offset added to the covariance matrices to handle numerical issues such as matrix singularity (default: 1e-6).
- Type:
float, Optional
References
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, Sepp Hochreiter - GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium - Annual Conference on Neural Information Processing Systems, 2016.
- calculate(real_dist_df, synth_dist_df)#
Compute the Frechet distance between two distributions by comparing the mean and covariance of the samples provided.
- Parameters:
real_dist_df (pandas.DataFrame) – Set of samples representing distribution real_dist.
synth_dist_df (pandas.DataFrame) – Set of samples representing distribution synth_dist.
- Returns:
A numpy array containing the Frechet Distance.
- Return type:
numpy.ndarray