class_docstr: NCM Classifier.
  NCMClassifier performs nearest class mean classification
  measuring the distance between the input tensor and the
  ones stored in 'self.class_means'.
  
  Before being used for inference, NCMClassifier needs to
  be updated with a mean vector per class, by calling
  `update_class_means_dict`.
  
  This class registers a `class_means` buffer that stores
  the class means in a single tensor of shape
  [max_class_id_seen, feature_size]. Classes with ID smaller
  than `max_class_id_seen` are associated with a 0-vector.
docstr: :param normalize: whether to normalize the input with
      2-norm = 1 before computing the distance.
docstr_tok: [":","param","normalize",":","whether","to","normalize","the","input","with","2-norm","=","1","before","computing","the","distance","."]
code: def __init__(self, normalize: bool = True):
      """
      :param normalize: whether to normalize the input with
          2-norm = 1 before computing the distance.
      """
      super().__init__()
      # vectorized version of class means
      self.register_buffer("class_means", None)
      self.class_means_dict = {}
  
      self.normalize = normalize
      self.max_class = -1
  
file_path: avalanche/avalanche/models/ncm_classifier.py
imports: from typing import Dict
  import torch
  from torch import Tensor, nn
  from avalanche.models import DynamicModule
label_desc: Use image node_id 1 to create a new NCMClassifier object from inherited base classes: DynamicModule with example: obj = NCMClassifier(normalize)