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: Accumulate seen outputs of the network and keep counts.
docstr_tok: ["Accumulate","seen","outputs","of","the","network","and","keep","counts","."]
code: def _update_running_prototypes(self, strategy):
      """Accumulate seen outputs of the network and keep counts."""
      y_unique = torch.unique(strategy.mb_y).squeeze().view(-1)
      for idx in range(y_unique.size(0)):
          c = y_unique[idx].item()
          idxs = torch.nonzero(strategy.mb_y == c).squeeze(1)
          p_tmp_batch = (
              strategy.mb_output[idxs]
              .sum(dim=0)
              .unsqueeze(0)
              .to(strategy.device)
          )
  
          p_init, cnt_init = (
              self.tmp_p_mem[c] if c in self.tmp_p_mem else (0, 0)
          )
          self.tmp_p_mem[c] = (
              p_init + p_tmp_batch,
              cnt_init + len(idxs),
          )
  
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 7 for calling the CoPEPlugin obj's underlying member method code with example usage: obj._update_running_prototypes(strategy) without return types