class_docstr: Updates NCM prototypes
  using the data contained inside a memory buffer
  (as is is done in ICaRL)
class_docstr_tok: ["Updates","NCM","prototypes","using","the","data","contained","inside","a","memory","buffer","(","as","is","is","done","in","ICaRL",")"]
code: def after_training_exp(self, strategy, **kwargs):
      _check_has_ncm(strategy.model)
      self.storage_policy.update(strategy)
      class_means_dict = compute_class_means(
          strategy.model,
          self.storage_policy.buffer.eval(),
          batch_size=strategy.train_mb_size,
          normalize=strategy.model.eval_classifier.normalize,
          device=strategy.device,
      )
      strategy.model.eval_classifier.replace_class_means_dict(
          class_means_dict
      )
  
imports: import collections
  import copy
  from typing import Dict
  import numpy
  import torch
  import torch.nn.functional
  import tqdm
  from torch import Tensor, nn
  from avalanche.benchmarks.utils import concat_datasets
  from avalanche.training.plugins import SupervisedPlugin
  from avalanche.training.storage_policy import ClassBalancedBuffer
  from avalanche.training.templates import SupervisedTemplate
  from avalanche.models import NCMClassifier
label_desc: Use image node_id 2 for calling the MemoryNCMUpdate obj's underlying member method code with example usage: obj.after_training_exp(strategy) without return types