class_docstr: Maximum a Posteriori Probability criterion.
  It implements Lattice-Free Maximum Mutual Information (LF-MMI) and LF-boosted-MMI (LF-bMMI) losses.
  
  Based on https://github.com/k2-fsa/snowfall/blob/master/snowfall/objectives/mmi.py
  
  cfg takes precedence over all optional parameters
  We keep explicit parameter setting to be able to create an instance without the need of a config.
code: def __init__(
      self,
      num_classes: int,
      blank: int,
      reduction: str,
      cfg: Optional[DictConfig] = None,
      topo_type: str = "default",
      topo_with_self_loops: bool = True,
      token_lm: Optional[Union["k2.Fsa", str]] = None,
      intersect_pruned: bool = False,
      intersect_conf: GraphIntersectDenseConfig = GraphIntersectDenseConfig(),
      boost_coeff: float = 0.0,
  ):
      super().__init__(
          num_classes=num_classes,
          blank=blank,
          reduction=reduction,
          cfg=cfg,
          topo_type=topo_type,
          topo_with_self_loops=topo_with_self_loops,
      )
      if cfg is not None:
          token_lm = cfg.get("token_lm", token_lm)
          intersect_pruned = cfg.get(
              "intersect_pruned", intersect_pruned
          )
          intersect_conf = cfg.get("intersect_conf", intersect_conf)
          boost_coeff = cfg.get("boost_coeff", boost_coeff)
      self.boost_coeff = boost_coeff
      self._intersect_calc_scores_impl = (
          self._intersect_calc_scores_impl_pruned
          if intersect_pruned
          else self._intersect_calc_scores_impl_exact_opt
      )
      self.intersect_conf = intersect_conf
      self.graph_compiler = (
          None  # expected to be initialized in .update_graph(...)
      )
      if token_lm is None:
          logging.warning(
              f"""token_lm is empty. 
                              Trainable token_lm is not supported yet. 
                              Please call .update_graph(token_lm) before using."""
          )
      else:
          self.lm_graph = (
              load_graph(token_lm)
              if isinstance(token_lm, str)
              else token_lm
          )
          if self.lm_graph is None:
              raise ValueError(f"""lm_graph is empty.""")
          else:
              self.update_graph(self.lm_graph)
  
imports: from abc import abstractmethod
  from typing import Any, Optional, Tuple, Union
  import torch
  from omegaconf import DictConfig
  from nemo.collections.asr.parts.k2.classes import GraphIntersectDenseConfig
  from nemo.collections.asr.parts.k2.loss_mixins import CtcK2Mixin
  from nemo.collections.asr.parts.k2.ml_loss import MLLoss
  from nemo.collections.asr.parts.k2.utils import create_sparse_wrapped, get_tot_objf_and_finite_mask, invert_permutation, load_graph
  from nemo.core.utils.k2_guard import k2
  from nemo.utils import logging
label_desc: Use image node_id 1 to create a new MAPLoss object from inherited base classes: MLLoss with example: obj = MAPLoss(num_classes, blank, reduction, cfg, topo_type, topo_with__loops, token_lm, intersect_pruned, intersect_conf, boost_coeff)