class_docstr: FID with SwAV backbone.
  
  This implements the Frechet 'Inception' Distance metric, but with a SwAV
  ResNet backbone instead of an Inception V3 backbone. The details are
  described in the following paper:
  
  The Role of ImageNet Classes in Fréchet Inception Distance
  Tuomas Kynkäänniemi, Tero Karras, Miika Aittala, Timo Aila, Jaakko Lehtinen
  
  Args:
      normalize: Whether to apply ImageNet normalization prior to running the
          SwAV ResNet.
      kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more
          info.
class_docstr_tok: ["FID","with","SwAV","backbone",".","This","implements","the","Frechet","'Inception","'","Distance","metric",",","but","with","a","SwAV","ResNet","backbone","instead","of","an","Inception","V3","backbone",".","The","details","are","described","in","the","following","paper",":","The","Role","of","ImageNet","Classes","in","Fr\u00e9chet","Inception","Distance","Tuomas","Kynk\u00e4\u00e4nniemi",",","Tero","Karras",",","Miika","Aittala",",","Timo","Aila",",","Jaakko","Lehtinen","Args",":","normalize",":","Whether","to","apply","ImageNet","normalization","prior","to","running","the","SwAV","ResNet",".","kwargs",":","Additional","keyword","arguments",",","see",":","ref",":","`","Metric","kwargs","`","for","more","info","."]
code: def __init__(self, normalize: bool = True, **kwargs: Any) -> None:
      super().__init__(**kwargs)
  
      self.feature_extractor = NoTrainSwAV()
  
      if not isinstance(normalize, bool):
          raise ValueError("Argument `normalize` expected to be a bool")
  
      if normalize:
          self.normalize = Normalize(
              mean=[0.485, 0.456, 0.406], std=[0.228, 0.224, 0.225]
          )
      else:
          self.normalize = nn.Identity()
  
      self.add_state("real_features", [], dist_reduce_fx="cat")
      self.add_state("fake_features", [], dist_reduce_fx="cat")
  
file_path: NeuralCompression/neuralcompression/metrics/_fid_swav.py
imports: from typing import Any, List, Optional
  import torch
  import torch.nn
  from torch import Tensor
  from torch.nn import Module
  from torch_fidelity.metric_fid import fid_features_to_statistics, fid_statistics_to_metric
  from torchmetrics.metric import Metric
  from torchvision.transforms import Normalize
label_desc: Use image node_id 1 to create a new FrechetInceptionDistanceSwAV object from inherited base classes: Metric with example: obj = FrechetInceptionDistanceSwAV(normalize)