class_docstr: At the end of each experience, this plugin metric reports the average
  top-k accuracy for only the experiences
  that the model has been trained on so far.
  
  This metric only works at eval time.
class_docstr_tok: ["At","the","end","of","each","experience",",","this","plugin","metric","reports","the","average","top-k","accuracy","for","only","the","experiences","that","the","model","has","been","trained","on","so","far",".","This","metric","only","works","at","eval","time","."]
docstr: Only update the top-k accuracy with results from experiences
  that have been trained on
docstr_tok: ["Only","update","the","top-k","accuracy","with","results","from","experiences","that","have","been","trained","on"]
code: def update(self, strategy):
      """
      Only update the top-k accuracy with results from experiences
      that have been trained on
      """
      if (
          strategy.experience.current_experience
          <= self._current_experience
      ):
          TopkAccuracyPluginMetric.update(self, strategy)
  
imports: from typing import TYPE_CHECKING, List, Union, Dict
  import torch
  from torch import Tensor
  import torchmetrics
  from torchmetrics.functional import accuracy
  from avalanche.evaluation import Metric, GenericPluginMetric
  from avalanche.evaluation.metrics.mean import Mean
  from avalanche.evaluation.metric_utils import phase_and_task
  from collections import defaultdict
  from packaging import version
label_desc: Use image node_id 3 for calling the TrainedExperienceTopkAccuracy obj's underlying member method code with example usage: obj.update(strategy) without return types