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).
docstr: :param mem_size: max number of input samples in the replay memory.
  :param n_classes: total number of classes that will be encountered. This
      is used to output predictions for all classes, with zero probability
      for unseen classes.
  :param p_size: The prototype size, which equals the feature size of the
      last layer.
  :param alpha: The momentum for the exponentially moving average of the
      prototypes.
  :param T: The softmax temperature, used as a concentration parameter.
  :param max_it_cnt: How many processing iterations per batch (experience)
docstr_tok: [":","param","mem_size",":","max","number","of","input","samples","in","the","replay","memory",".",":","param","n_classes",":","total","number","of","classes","that","will","be","encountered",".","This","is","used","to","output","predictions","for","all","classes",",","with","zero","probability","for","unseen","classes",".",":","param","p_size",":","The","prototype","size",",","which","equals","the","feature","size","of","the","last","layer",".",":","param","alpha",":","The","momentum","for","the","exponentially","moving","average","of","the","prototypes",".",":","param","T",":","The","softmax","temperature",",","used","as","a","concentration","parameter",".",":","param","max_it_cnt",":","How","many","processing","iterations","per","batch","(","experience",")"]
code: def __init__(
      self,
      mem_size=200,
      n_classes=10,
      p_size=100,
      alpha=0.99,
      T=0.1,
      max_it_cnt=1,
  ):
      """
      :param mem_size: max number of input samples in the replay memory.
      :param n_classes: total number of classes that will be encountered. This
          is used to output predictions for all classes, with zero probability
          for unseen classes.
      :param p_size: The prototype size, which equals the feature size of the
          last layer.
      :param alpha: The momentum for the exponentially moving average of the
          prototypes.
      :param T: The softmax temperature, used as a concentration parameter.
      :param max_it_cnt: How many processing iterations per batch (experience)
      """
      super().__init__()
      self.n_classes = n_classes
      self.it_cnt = 0
      self.max_it_cnt = max_it_cnt
  
      # Operational memory: replay memory
      self.mem_size = mem_size  # replay memory size
      self.storage_policy = ClassBalancedBuffer(
          max_size=self.mem_size, adaptive_size=True
      )
  
      # Operational memory: Prototypical memory
      # Scales with nb classes * feature size
      self.p_mem: Dict[int, Tensor] = {}
      self.p_size = p_size  # Prototype size determined on runtime
      self.tmp_p_mem = (
          {}
      )  # Intermediate to process batch for multiple times
      self.alpha = alpha
      self.p_init_adaptive = False  # Only create proto when class seen
  
      # PPP-loss
      self.T = T
      self.ppp_loss = PPPloss(self.p_mem, T=self.T)
  
      self.initialized = False
  
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 1 to create a new CoPEPlugin object from inherited base classes: SupervisedPlugin with example: obj = CoPEPlugin(mem_size, n_classes, p_size, alpha, T, max_it_cnt)