pytorch / pytorch/ignite

Calculation of FID metric made use of classification probabilities instead of feature vectors

Open Beginner friendly
#3,221 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
4.8k
Forks
726
Avg merge
5d 21h
Merged PRs (30d)
5

Description

Based on my understanding, the calculation of fid should make use of feature vector(dim=2048) from the max pool layers of InceptionNet.

However, the FID() metric in fid.py is initiliased as below:

if num_features is None and feature_extractor is None:
    num_features = 1000
    feature_extractor = InceptionModel(return_features=False, device=device)

The InceptionModel return prediction probabilities(dim=1000) if return_features is set to False by specification. update() then make use of this this feature_extractor to get the probabilities instead of feature vectors.

I think feature_extractor should be InceptionModel(return_features=True, device=device) instead?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in fid.py by tracing FID() initialization and update() through InceptionModel. Check how return_features and num_features determine the extracted representation, then verify the metric uses 2048-dimensional feature vectors rather than 1000-dimensional classification probabilities and run the relevant existing FID tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.