class_docstr: Continual Prototype Evolution plugin.
  
  Each class has a prototype for nearest-neighbor classification.
  The prototypes are updated continually with an exponentially moving average,
  using class-balanced replay to keep the prototypes up-to-date.
  The embedding space is optimized using the PseudoPrototypicalProxy-loss,
  exploiting both prototypes and batch information.
  
  This plugin doesn't use task identities in training or eval
  (data incremental) and is designed for online learning (1 epoch per task).
class_docstr_tok: ["Continual","Prototype","Evolution","plugin",".","Each","class","has","a","prototype","for","nearest-neighbor","classification",".","The","prototypes","are","updated","continually","with","an","exponentially","moving","average",",","using","class-balanced","replay","to","keep","the","prototypes","up-to-date",".","The","embedding","space","is","optimized","using","the","PseudoPrototypicalProxy-loss",",","exploiting","both","prototypes","and","batch","information",".","This","plugin","does","n't","use","task","identities","in","training","or","eval","(","data","incremental",")","and","is","designed","for","online","learning","(","1","epoch","per","task",")","."]
docstr: Initialize prototypes for previously unseen classes.
  :param targets: The targets Tensor to make prototypes for.
docstr_tok: ["Initialize","prototypes","for","previously","unseen","classes",".",":","param","targets",":","The","targets","Tensor","to","make","prototypes","for","."]
code: def _init_new_prototypes(self, targets: Tensor):
      """Initialize prototypes for previously unseen classes.
      :param targets: The targets Tensor to make prototypes for.
      """
      y_unique: Tensor = torch.unique(targets).squeeze().view(-1)
      for idx in range(y_unique.size(0)):
          c: int = y_unique[idx].item()
          if c not in self.p_mem:  # Init new prototype
              self.p_mem[c] = (
                  normalize(
                      torch.empty((1, self.p_size)).uniform_(-1, 1),
                      p=2,
                      dim=1,
                  )
                  .detach()
                  .to(targets.device)
              )
  
imports: from typing import Dict
  import torch
  from torch import Tensor
  from torch.nn.functional import normalize
  from torch.nn.modules import Module
  from avalanche.training.utils import get_last_fc_layer, swap_last_fc_layer
  from avalanche.training.plugins.strategy_plugin import SupervisedPlugin
  from avalanche.training.storage_policy import ClassBalancedBuffer
  from avalanche.benchmarks.utils.data_loader import ReplayDataLoader
label_desc: Use image node_id 6 for calling the CoPEPlugin obj's underlying member method code with example usage: obj._init_new_prototypes(targets) without return types