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: Update the prototypes based on the running averages.
docstr_tok: ["Update","the","prototypes","based","on","the","running","averages","."]
code: def _update_prototypes(self):
      """Update the prototypes based on the running averages."""
      for c, (p_sum, p_cnt) in self.tmp_p_mem.items():
          incr_p = normalize(p_sum / p_cnt, p=2, dim=1)  # L2 normalized
          old_p = self.p_mem[c].clone()
          new_p_momentum = (
              self.alpha * old_p + (1 - self.alpha) * incr_p
          )  # Momentum update
          self.p_mem[c] = normalize(new_p_momentum, p=2, dim=1).detach()
      self.tmp_p_mem = {}
  
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 9 for calling the CoPEPlugin obj's underlying member method code with example usage: obj._update_prototypes() without return types