class_docstr: UnivNet model (https://arxiv.org/abs/2106.07889) that is used to generate audio from mel spectrogram.
class_docstr_tok: ["UnivNet","model","(","https",":","\/\/arxiv.org\/abs\/2106.07889",")","that","is","used","to","generate","audio","from","mel","spectrogram","."]
code: def configure_optimizers(self):
      optim_config = self._cfg.optim.copy()
  
      OmegaConf.set_struct(optim_config, False)
      sched_config = optim_config.pop("sched", None)
      OmegaConf.set_struct(optim_config, True)
  
      # Backward compatibility
      if sched_config is None and "sched" in self._cfg:
          sched_config = self._cfg.sched
  
      optim_g = instantiate(
          optim_config,
          params=self.generator.parameters(),
      )
      optim_d = instantiate(
          optim_config,
          params=itertools.chain(
              self.mrd.parameters(), self.mpd.parameters()
          ),
      )
  
      if sched_config is not None:
          max_steps = self._cfg.get("max_steps", None)
          if max_steps is None or max_steps < 0:
              max_steps = self._get_max_steps()
  
          warmup_steps = UnivNetModel.get_warmup_steps(
              max_steps=max_steps,
              warmup_steps=sched_config.get("warmup_steps", None),
              warmup_ratio=sched_config.get("warmup_ratio", None),
          )
  
          OmegaConf.set_struct(sched_config, False)
          sched_config["max_steps"] = max_steps
          sched_config["warmup_steps"] = warmup_steps
          sched_config.pop("warmup_ratio", None)
          OmegaConf.set_struct(sched_config, True)
  
          scheduler_g = prepare_lr_scheduler(
              optimizer=optim_g,
              scheduler_config=sched_config,
              train_dataloader=self._train_dl,
          )
  
          scheduler_d = prepare_lr_scheduler(
              optimizer=optim_d,
              scheduler_config=sched_config,
              train_dataloader=self._train_dl,
          )
  
          return [optim_g, optim_d], [scheduler_g, scheduler_d]
      else:
          return [optim_g, optim_d]
  
imports: import itertools
  from typing import Dict
  import torch
  import torch.nn.functional
  from hydra.utils import instantiate
  from omegaconf import DictConfig, OmegaConf, open_dict
  from pytorch_lightning.loggers.wandb import WandbLogger
  from nemo.collections.tts.losses.hifigan_losses import DiscriminatorLoss, GeneratorLoss
  from nemo.collections.tts.losses.stftlosses import MultiResolutionSTFTLoss
  from nemo.collections.tts.models.base import Vocoder
  from nemo.collections.tts.modules.univnet_modules import MultiPeriodDiscriminator, MultiResolutionDiscriminator
  from nemo.collections.tts.parts.utils.helpers import get_batch_size, get_num_workers, plot_spectrogram_to_numpy
  from nemo.core import Exportable
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.neural_types.elements import AudioSignal, MelSpectrogramType
  from nemo.core.neural_types.neural_type import NeuralType
  from nemo.core.optim.lr_scheduler import compute_max_steps, prepare_lr_scheduler
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 4 for calling the UnivNetModel obj's underlying member method code with example usage: obj.configure_optimizers() and returns: list,  list, list