class_docstr: Generator adversarial loss module.
class_docstr_tok: ["Generator","adversarial","loss","module","."]
docstr: Initialize GeneratorAversarialLoss module.
  
  Args:
      average_by_discriminators (bool): Whether to average the loss by
          the number of discriminators.
      loss_type (str): Loss type, "mse" or "hinge".
docstr_tok: ["Initialize","GeneratorAversarialLoss","module",".","Args",":","average_by_discriminators","(","bool",")",":","Whether","to","average","the","loss","by","the","number","of","discriminators",".","loss_type","(","str",")",":","Loss","type",",","``","mse","''","or","``","hinge","''","."]
code: def __init__(
      self,
      average_by_discriminators: bool = True,
      loss_type: str = "mse",
  ):
      """Initialize GeneratorAversarialLoss module.
  
      Args:
          average_by_discriminators (bool): Whether to average the loss by
              the number of discriminators.
          loss_type (str): Loss type, "mse" or "hinge".
  
      """
      super().__init__()
      self.average_by_discriminators = average_by_discriminators
      assert loss_type in [
          "mse",
          "hinge",
      ], f"{loss_type} is not supported."
      if loss_type == "mse":
          self.criterion = self._mse_loss
      else:
          self.criterion = self._hinge_loss
  
imports: from typing import List, Optional, Tuple, Union
  import torch
  import torch.nn.functional
  from espnet2.tts.feats_extract.log_mel_fbank import LogMelFbank
label_desc: Use image node_id 1 to create a new GeneratorAdversarialLoss object from inherited base classes: torch.nn with example: obj = GeneratorAdversarialLoss(average_by_discriminators, loss_type)