class_docstr: GAN-based model to add details to blurry spectrograms from TTS models like Tacotron or FastPitch. Based on StyleGAN 2 [1]
  [1] Karras et. al. - Analyzing and Improving the Image Quality of StyleGAN (https://arxiv.org/abs/1912.04958)
class_docstr_tok: ["GAN-based","model","to","add","details","to","blurry","spectrograms","from","TTS","models","like","Tacotron","or","FastPitch",".","Based","on","StyleGAN","2","[","1","]","[","1","]","Karras","et",".","al",".","-","Analyzing","and","Improving","the","Image","Quality","of","StyleGAN","(","https",":","\/\/arxiv.org\/abs\/1912.04958",")"]
docstr: Generator forward pass. Noise inputs will be generated.
  
  input_spectrograms: batch of spectrograms, typically synthetic
  lengths: length for every spectrogam in the batch
  mixing: style mixing, usually True during training
  normalize: normalize spectrogram range to ~[0, 1], True for normal use
  
  returns: batch of enhanced spectrograms
  
  For explanation of style mixing refer to [1]
  [1] Karras et. al. - A Style-Based Generator Architecture for Generative Adversarial Networks, 2018 (https://arxiv.org/abs/1812.04948)
docstr_tok: ["Generator","forward","pass",".","Noise","inputs","will","be","generated",".","input_spectrograms",":","batch","of","spectrograms",",","typically","synthetic","lengths",":","length","for","every","spectrogam","in","the","batch","mixing",":","style","mixing",",","usually","True","during","training","normalize",":","normalize","spectrogram","range","to","~","[","0",",","1","]",",","True","for","normal","use","returns",":","batch","of","enhanced","spectrograms","For","explanation","of","style","mixing","refer","to","[","1","]","[","1","]","Karras","et",".","al",".","-","A","Style-Based","Generator","Architecture","for","Generative","Adversarial","Networks",",","2018","(","https",":","\/\/arxiv.org\/abs\/1812.04948",")"]
code: def forward(
      self,
      *,
      input_spectrograms: torch.Tensor,
      lengths: torch.Tensor,
      mixing: bool = False,
      normalize: bool = True,
  ):
      """
      Generator forward pass. Noise inputs will be generated.
  
      input_spectrograms: batch of spectrograms, typically synthetic
      lengths: length for every spectrogam in the batch
      mixing: style mixing, usually True during training
      normalize: normalize spectrogram range to ~[0, 1], True for normal use
  
      returns: batch of enhanced spectrograms
  
      For explanation of style mixing refer to [1]
      [1] Karras et. al. - A Style-Based Generator Architecture for Generative Adversarial Networks, 2018 (https://arxiv.org/abs/1812.04948)
      """
  
      return self.forward_with_custom_noise(
          input_spectrograms=input_spectrograms,
          lengths=lengths,
          mixing=mixing,
          normalize=normalize,
          zs=None,
          ws=None,
          noise=None,
      )
  
imports: from random import random, randrange
  from typing import List, Optional
  import torch
  import torch.nn.functional
  from einops import rearrange
  from hydra.utils import instantiate
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from pytorch_lightning.loggers import TensorBoardLogger, WandbLogger
  from torch.utils.tensorboard.writer import SummaryWriter
  from nemo.collections.tts.losses.spectrogram_enhancer_losses import ConsistencyLoss, GeneratorLoss, GradientPenaltyLoss, HingeLoss
  from nemo.collections.tts.parts.utils.helpers import mask_sequence_tensor, to_device_recursive
  from nemo.core import Exportable, ModelPT, PretrainedModelInfo, typecheck
  from nemo.core.neural_types import LengthsType, MelSpectrogramType, NeuralType
  from nemo.core.neural_types.elements import BoolType
  from nemo.utils import logging
label_desc: Use image node_id 8 for calling the SpectrogramEnhancerModel obj's underlying member method code with example usage: obj.forward() and returns: self