class_docstr: Family of loss functions based on various lattice scores.
  
  Note:
      Requires k2 v1.14 or later to be installed to use this loss function.
  
  Losses can be selected via the config, and optionally be passed keyword arguments as follows.
  
  Examples:
      .. code-block:: yaml
  
          model:  # Model config
              ...
              graph_module_cfg:  # Config for graph modules, e.g. LatticeLoss
                  criterion_type: "map"
                  loss_type: "mmi"
                  split_batch_size: 0
                  backend_cfg:
                      topo_type: "default"       # other options: "compact", "shared_blank", "minimal"
                      topo_with_self_loops: true
                      token_lm: <token_lm_path>  # must be provided for criterion_type: "map"
  
  Args:
      num_classes: Number of target classes for the decoder network to predict.
          (Excluding the blank token).
  
      reduction: Type of reduction to perform on loss. Possible values are `mean_batch`, `mean`, `sum`, or None.
          None will return a torch vector comprising the individual loss values of the batch.
  
      backend: Which backend to use for loss calculation. Currently only `k2` is supported.
  
      criterion_type: Type of criterion to use. Choices: `ml` and `map`, 
          with `ml` standing for Maximum Likelihood and `map` for Maximum A Posteriori Probability.
  
      loss_type: Type of the loss function to use. Choices: `ctc` and `rnnt` for `ml`, and `mmi` for `map`.
  
      split_batch_size: Local batch size. Used for memory consumption reduction at the cost of speed performance.
          Effective if complies 0 < split_batch_size < batch_size.
  
      graph_module_cfg: Optional Dict of (str, value) pairs that are passed to the backend loss function.
class_docstr_tok: ["Family","of","loss","functions","based","on","various","lattice","scores",".","Note",":","Requires","k2","v1.14","or","later","to","be","installed","to","use","this","loss","function",".","Losses","can","be","selected","via","the","config",",","and","optionally","be","passed","keyword","arguments","as","follows",".","Examples",":","..","code-block",":",":","yaml","model",":","#","Model","config","...","graph_module_cfg",":","#","Config","for","graph","modules",",","e.g",".","LatticeLoss","criterion_type",":","``","map","''","loss_type",":","``","mmi","''","split_batch_size",":","0","backend_cfg",":","topo_type",":","``","default","''","#","other","options",":","``","compact","''",",","``","shared_blank","''",",","``","minimal","''","topo_with_self_loops",":","true","token_lm",":","<","token_lm_path",">","#","must","be","provided","for","criterion_type",":","``","map","''","Args",":","num_classes",":","Number","of","target","classes","for","the","decoder","network","to","predict",".","(","Excluding","the","blank","token",")",".","reduction",":","Type","of","reduction","to","perform","on","loss",".","Possible","values","are","`","mean_batch","`",",","`","mean","`",",","`","sum","`",",","or","None",".","None","will","return","a","torch","vector","comprising","the","individual","loss","values","of","the","batch",".","backend",":","Which","backend","to","use","for","loss","calculation",".","Currently","only","`","k2","`","is","supported",".","criterion_type",":","Type","of","criterion","to","use",".","Choices",":","`","ml","`","and","`","map","`",",","with","`","ml","`","standing","for","Maximum","Likelihood","and","`","map","`","for","Maximum","A","Posteriori","Probability",".","loss_type",":","Type","of","the","loss","function","to","use",".","Choices",":","`","ctc","`","and","`","rnnt","`","for","`","ml","`",",","and","`","mmi","`","for","`","map","`",".","split_batch_size",":","Local","batch","size",".","Used","for","memory","consumption","reduction","at","the","cost","of","speed","performance",".","Effective","if","complies","0","<","split_batch_size","<","batch_size",".","graph_module_cfg",":","Optional","Dict","of","(","str",",","value",")","pairs","that","are","passed","to","the","backend","loss","function","."]
docstr: Output types definitions for LatticeLoss.
  loss:
      NeuralType(None)
docstr_tok: ["Output","types","definitions","for","LatticeLoss",".","loss",":","NeuralType","(","None",")"]
code: def output_types(self):
      """Output types definitions for LatticeLoss.
      loss:
          NeuralType(None)
      """
      return {"loss": NeuralType(elements_type=LossType())}
  
file_path: NeMo/nemo/collections/asr/losses/lattice_losses.py
imports: from typing import Optional
  import torch
  from omegaconf import DictConfig
  from nemo.core.classes import Loss, typecheck
  from nemo.core.neural_types import LabelsType, LengthsType, LogprobsType, LossType, NeuralType
label_desc: Use image node_id 2 for calling the LatticeLoss obj's underlying member method code with example usage: obj.output_types() and returns: dict