BaşlayınÜcretsiz Başlayın

Fréchet Inception Distance

The visual inspection of generated images is a great start. But given they look okay, a more precise, quantitative evaluation will be helpful to understand the generator's performance. You will evaluate your GAN using the Fréchet Inception Distance, or FID.

Two tensors with fake and real images, 32 examples each, are available to you as fake and real, respectively. Use them to compute the FID!

Bu egzersiz

Deep Learning for Images with PyTorch

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Import FrechetInceptionDistance from the appropriate torchmetrics module.
  • Instantiate the FID metric based on the 64th Inception feature layer and assign it to fid.
  • Update fid with real image tensor, multiplied by 255 and parsed to torch.uint8.
  • Compute the fid metric, assigning the output to fid_score.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import FrechetInceptionDistance
____

# Instantiate FID
fid = ____(____)

# Update FID with real images
fid.update((fake * 255).to(torch.uint8), real=False)
fid.update(____)

# Compute the metric
fid_score = ____
print(fid_score)
Kodu Düzenle ve Çalıştır