class_docstr: At the end of each experience, this plugin metric reports
  the average top-k accuracy over all patterns seen in that experience.
  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","over","all","patterns","seen","in","that","experience",".","This","metric","only","works","at","eval","time","."]
docstr: Creates an instance of the ExperienceTopkAccuracy metric.
docstr_tok: ["Creates","an","instance","of","the","ExperienceTopkAccuracy","metric","."]
code: def __init__(self, top_k):
      """
      Creates an instance of the ExperienceTopkAccuracy metric.
      """
      super(ExperienceTopkAccuracy, self).__init__(
          reset_at="experience",
          emit_at="experience",
          mode="eval",
          top_k=top_k,
      )
      self.top_k = top_k
  
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 1 to create a new ExperienceTopkAccuracy object from inherited base classes: TopkAccuracyPluginMetric with example: obj = ExperienceTopkAccuracy(top_k)