code: def loss_metrics(
      *,
      minibatch=False,
      epoch=False,
      epoch_running=False,
      experience=False,
      stream=False,
  ) -> List[LossPluginMetric]:
      """
      Helper method that can be used to obtain the desired set of
      plugin metrics.
  
      :param minibatch: If True, will return a metric able to log
          the minibatch loss at training time.
      :param epoch: If True, will return a metric able to log
          the epoch loss at training time.
      :param epoch_running: If True, will return a metric able to log
          the running epoch loss at training time.
      :param experience: If True, will return a metric able to log
          the loss on each evaluation experience.
      :param stream: If True, will return a metric able to log
          the loss averaged over the entire evaluation stream of experiences.
  
      :return: A list of plugin metrics.
      """
  
      metrics: List[LossPluginMetric] = []
      if minibatch:
          metrics.append(MinibatchLoss())
  
      if epoch:
          metrics.append(EpochLoss())
  
      if epoch_running:
          metrics.append(RunningEpochLoss())
  
      if experience:
          metrics.append(ExperienceLoss())
  
      if stream:
          metrics.append(StreamLoss())
  
      return metrics
  
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 for calling a global function with example usage: loss_metrics() and returns: metrics