class_docstr: Adds utilities for computing interCTC loss from https://arxiv.org/abs/2102.03216.
  
  To use, make sure encoder accesses ``interctc['capture_layers']``
  property in the AccessMixin and registers ``interctc/layer_output_X`` and
  ``interctc/layer_length_X`` for all layers that we want to get loss from.
  Additionally, specify the following config parameters to set up loss::
  
      interctc:
          # can use different values
          loss_weights: [0.3]
          apply_at_layers: [8]
  
  Then call
  
      * ``self.setup_interctc(ctc_decoder_name, ctc_loss_name, ctc_wer_name)``
        in the init method
      * ``self.add_interctc_losses`` after computing regular loss.
      * ``self.finalize_interctc_metrics(metrics, outputs, prefix="val_")``
        in the `multi_validation_epoch_end` method.
      * ``self.finalize_interctc_metrics(metrics, outputs, prefix="test_")``
        in the `multi_test_epoch_end` method.
class_docstr_tok: ["Adds","utilities","for","computing","interCTC","loss","from","https",":","\/\/arxiv.org\/abs\/2102.03216",".","To","use",",","make","sure","encoder","accesses","``","interctc","[","'capture_layers","'","]","``","property","in","the","AccessMixin","and","registers","``","interctc\/layer_output_X","``","and","``","interctc\/layer_length_X","``","for","all","layers","that","we","want","to","get","loss","from",".","Additionally",",","specify","the","following","config","parameters","to","set","up","loss",":",":","interctc",":","#","can","use","different","values","loss_weights",":","[","0.3","]","apply_at_layers",":","[","8","]","Then","call","*","``","self.setup_interctc","(","ctc_decoder_name",",","ctc_loss_name",",","ctc_wer_name",")","``","in","the","init","method","*","``","self.add_interctc_losses","``","after","computing","regular","loss",".","*","``","self.finalize_interctc_metrics","(","metrics",",","outputs",",","prefix=","''","val_","''",")","``","in","the","`","multi_validation_epoch_end","`","method",".","*","``","self.finalize_interctc_metrics","(","metrics",",","outputs",",","prefix=","''","test_","''",")","``","in","the","`","multi_test_epoch_end","`","method","."]
docstr: Setting the parameter to the ``self._interctc_params`` dictionary.
  
  Raises an error if trying to set decoder, loss or wer as those should
  always come from the main class.
docstr_tok: ["Setting","the","parameter","to","the","``","self._interctc_params","``","dictionary",".","Raises","an","error","if","trying","to","set","decoder",",","loss","or","wer","as","those","should","always","come","from","the","main","class","."]
code: def set_interctc_param(self, param_name, param_value):
      """Setting the parameter to the ``self._interctc_params`` dictionary.
  
      Raises an error if trying to set decoder, loss or wer as those should
      always come from the main class.
      """
      if param_name in ["decoder", "loss", "wer"]:
          raise ValueError(
              'Cannot set "decoder", "loss" or "wer" as parameters. '
              "They are always looked up in the main class state."
          )
      self._interctc_params[param_name] = param_value
  
file_path: NeMo/nemo/collections/asr/parts/mixins/interctc_mixin.py
imports: from typing import Dict, List, Optional, Tuple
  import torch
  from nemo.core.classes.mixins import AccessMixin
label_desc: Use image node_id 4 for calling the InterCTCMixin obj's underlying member method code with example usage: obj.set_interctc_param(param_name, param_value) without return types