class_docstr: Mixin for adding classification metrics to non-classifier models.
class_docstr_tok: ["Mixin","for","adding","classification","metrics","to","non-classifier","models","."]
code: def __init__(self, opt: Opt, shared=None):
      super().__init__(opt, shared)
      if shared is None:
          self.reset_metrics()
  
imports: from parlai.core.params import ParlaiParser
  import random
  from typing import List, Optional
  import numpy
  import torch
  from torch import nn
  from parlai.agents.transformer.modules import TransformerDecoder, TransformerGeneratorModel
  from parlai.core.agents import Agent
  from parlai.core.message import Message
  from parlai.core.opt import Opt
  from parlai.core.torch_classifier_agent import ConfusionMatrixMetric, WeightedF1Metric
  from parlai.utils.misc import warn_once
label_desc: Use image node_id 1 to create a new ClassificationMixin object from inherited base classes: Agent with example: obj = ClassificationMixin(opt, shared)