docstr: Multi-Layer Permutation Invariant Training Solver.
  
  Compute the PIT loss given inferences of multiple layers and a single reference.
  It also support single inference and single reference in evaluation stage.
  
  Args:
      criterion (AbsEnhLoss): an instance of AbsEnhLoss
      weight (float): weight (between 0 and 1) of current loss
          for multi-task learning.
      independent_perm (bool):
          If True, PIT will be performed in forward to find the best permutation;
          If False, the permutation from the last LossWrapper output will be
          inherited.
          Note: You should be careful about the ordering of loss
          wrappers defined in the yaml config, if this argument is False.
      layer_weights (Optional[List[float]]): weights for each layer
          If not None, the loss of each layer will be weighted-summed using the
          specified weights.
docstr_tok: ["Multi-Layer","Permutation","Invariant","Training","Solver",".","Compute","the","PIT","loss","given","inferences","of","multiple","layers","and","a","single","reference",".","It","also","support","single","inference","and","single","reference","in","evaluation","stage",".","Args",":","criterion","(","AbsEnhLoss",")",":","an","instance","of","AbsEnhLoss","weight","(","float",")",":","weight","(","between","0","and","1",")","of","current","loss","for","multi-task","learning",".","independent_perm","(","bool",")",":","If","True",",","PIT","will","be","performed","in","forward","to","find","the","best","permutation",";","If","False",",","the","permutation","from","the","last","LossWrapper","output","will","be","inherited",".","Note",":","You","should","be","careful","about","the","ordering","of","loss","wrappers","defined","in","the","yaml","config",",","if","this","argument","is","False",".","layer_weights","(","Optional","[","List","[","float","]","]",")",":","weights","for","each","layer","If","not","None",",","the","loss","of","each","layer","will","be","weighted-summed","using","the","specified","weights","."]
code: def __init__(
      self,
      criterion: AbsEnhLoss,
      weight=1.0,
      independent_perm=True,
      layer_weights=None,
  ):
      """Multi-Layer Permutation Invariant Training Solver.
  
      Compute the PIT loss given inferences of multiple layers and a single reference.
      It also support single inference and single reference in evaluation stage.
  
      Args:
          criterion (AbsEnhLoss): an instance of AbsEnhLoss
          weight (float): weight (between 0 and 1) of current loss
              for multi-task learning.
          independent_perm (bool):
              If True, PIT will be performed in forward to find the best permutation;
              If False, the permutation from the last LossWrapper output will be
              inherited.
              Note: You should be careful about the ordering of loss
              wrappers defined in the yaml config, if this argument is False.
          layer_weights (Optional[List[float]]): weights for each layer
              If not None, the loss of each layer will be weighted-summed using the
              specified weights.
      """
      super().__init__()
      self.criterion = criterion
      self.weight = weight
      self.independent_perm = independent_perm
      self.solver = PITSolver(criterion, weight, independent_perm)
      self.layer_weights = layer_weights
  
imports: from espnet2.enh.loss.criterions.abs_loss import AbsEnhLoss
  from espnet2.enh.loss.wrappers.abs_wrapper import AbsLossWrapper
  from espnet2.enh.loss.wrappers.pit_solver import PITSolver
label_desc: Use image node_id 1 to create a new MultiLayerPITSolver object from inherited base classes: AbsLossWrapper with example: obj = MultiLayerPITSolver(criterion, weight, independent_perm, layer_weights)