class_docstr: The average top-k accuracy across all minibatches up to the current
  epoch iteration.
  This plugin metric only works at training time.
  
  At each iteration, this metric logs the top-k accuracy averaged over all
  patterns seen so far in the current epoch.
  The metric resets its state after each training epoch.
class_docstr_tok: ["The","average","top-k","accuracy","across","all","minibatches","up","to","the","current","epoch","iteration",".","This","plugin","metric","only","works","at","training","time",".","At","each","iteration",",","this","metric","logs","the","top-k","accuracy","averaged","over","all","patterns","seen","so","far","in","the","current","epoch",".","The","metric","resets","its","state","after","each","training","epoch","."]
docstr: Creates an instance of the RunningEpochTopkAccuracy metric.
docstr_tok: ["Creates","an","instance","of","the","RunningEpochTopkAccuracy","metric","."]
code: def __init__(self, top_k):
      """
      Creates an instance of the RunningEpochTopkAccuracy metric.
      """
  
      super(RunningEpochTopkAccuracy, self).__init__(
          reset_at="epoch",
          emit_at="iteration",
          mode="train",
          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 RunningEpochTopkAccuracy object from inherited base classes: TopkAccuracyPluginMetric with example: obj = RunningEpochTopkAccuracy(top_k)