class_docstr: Collection of Tacotron set-up based on provided config.
code: def __init__(self, c, stopnet_pos_weight=10, ga_sigma=0.4):
      super(TacotronLoss, self).__init__()
      self.stopnet_pos_weight = stopnet_pos_weight
      self.ga_alpha = c.ga_alpha
      self.decoder_diff_spec_alpha = c.decoder_diff_spec_alpha
      self.postnet_diff_spec_alpha = c.postnet_diff_spec_alpha
      self.decoder_alpha = c.decoder_loss_alpha
      self.postnet_alpha = c.postnet_loss_alpha
      self.decoder_ssim_alpha = c.decoder_ssim_alpha
      self.postnet_ssim_alpha = c.postnet_ssim_alpha
      self.config = c
  
      # postnet and decoder loss
      if c.loss_masking:
          self.criterion = (
              L1LossMasked(c.seq_len_norm)
              if c.model in ["Tacotron"]
              else MSELossMasked(c.seq_len_norm)
          )
      else:
          self.criterion = (
              nn.L1Loss() if c.model in ["Tacotron"] else nn.MSELoss()
          )
      # guided attention loss
      if c.ga_alpha > 0:
          self.criterion_ga = GuidedAttentionLoss(sigma=ga_sigma)
      # differential spectral loss
      if c.postnet_diff_spec_alpha > 0 or c.decoder_diff_spec_alpha > 0:
          self.criterion_diff_spec = DifferentailSpectralLoss(
              loss_func=self.criterion
          )
      # ssim loss
      if c.postnet_ssim_alpha > 0 or c.decoder_ssim_alpha > 0:
          self.criterion_ssim = SSIMLoss()
      # stopnet loss
      # pylint: disable=not-callable
      self.criterion_st = (
          BCELossMasked(pos_weight=torch.tensor(stopnet_pos_weight))
          if c.stopnet
          else None
      )
  
imports: import math
  import numpy
  import torch
  from torch import nn
  from inspect import signature
  from torch.nn import functional
  from TTS.tts.utils.generic_utils import sequence_mask
  from TTS.tts.utils.ssim import ssim
label_desc: Use image node_id 1 to create a new TacotronLoss object from inherited base classes: torch.nn with example: obj = TacotronLoss(c, stopnet_pos_weight, ga_sigma)