class_docstr: The minibatch loss metric.
  This plugin metric only works at training time.
  
  This metric computes the average loss over patterns
  from a single minibatch.
  It reports the result after each iteration.
  
  If a more coarse-grained logging is needed, consider using
  :class:`EpochLoss` instead.
class_docstr_tok: ["The","minibatch","loss","metric",".","This","plugin","metric","only","works","at","training","time",".","This","metric","computes","the","average","loss","over","patterns","from","a","single","minibatch",".","It","reports","the","result","after","each","iteration",".","If","a","more","coarse-grained","logging","is","needed",",","consider","using",":","class",":","`","EpochLoss","`","instead","."]
docstr: Creates an instance of the MinibatchLoss metric.
code: def __init__(self):
      """
      Creates an instance of the MinibatchLoss metric.
      """
      super(MinibatchLoss, self).__init__(
          reset_at="iteration", emit_at="iteration", mode="train"
      )
  
imports: from typing import List, Dict
  import torch
  from torch import Tensor
  from avalanche.evaluation import PluginMetric, Metric, GenericPluginMetric
  from avalanche.evaluation.metrics.mean import Mean
  from avalanche.evaluation.metric_utils import phase_and_task
  from collections import defaultdict
label_desc: Use image node_id 1 to create a new MinibatchLoss object from inherited base classes: LossPluginMetric with example: obj = MinibatchLoss()