code: def setup_discriminator(c):
      print(" > Discriminator Model: {}".format(c.discriminator_model))
      if "parallel_wavegan" in c.discriminator_model:
          MyModel = importlib.import_module(
              "TTS.vocoder.models.parallel_wavegan_discriminator"
          )
      else:
          MyModel = importlib.import_module(
              "TTS.vocoder.models." + c.discriminator_model.lower()
          )
      MyModel = getattr(
          MyModel, to_camel(c.discriminator_model.lower())
      )
      if c.discriminator_model in "random_window_discriminator":
          model = MyModel(
              cond_channels=c.audio["num_mels"],
              hop_length=c.audio["hop_length"],
              uncond_disc_donwsample_factors=c.discriminator_model_params[
                  "uncond_disc_donwsample_factors"
              ],
              cond_disc_downsample_factors=c.discriminator_model_params[
                  "cond_disc_downsample_factors"
              ],
              cond_disc_out_channels=c.discriminator_model_params[
                  "cond_disc_out_channels"
              ],
              window_sizes=c.discriminator_model_params["window_sizes"],
          )
      if c.discriminator_model in "melgan_multiscale_discriminator":
          model = MyModel(
              in_channels=1,
              out_channels=1,
              kernel_sizes=(5, 3),
              base_channels=c.discriminator_model_params[
                  "base_channels"
              ],
              max_channels=c.discriminator_model_params["max_channels"],
              downsample_factors=c.discriminator_model_params[
                  "downsample_factors"
              ],
          )
      if (
          c.discriminator_model
          == "residual_parallel_wavegan_discriminator"
      ):
          model = MyModel(
              in_channels=1,
              out_channels=1,
              kernel_size=3,
              num_layers=c.discriminator_model_params["num_layers"],
              stacks=c.discriminator_model_params["stacks"],
              res_channels=64,
              gate_channels=128,
              skip_channels=64,
              dropout=0.0,
              bias=True,
              nonlinear_activation="LeakyReLU",
              nonlinear_activation_params={"negative_slope": 0.2},
          )
      if c.discriminator_model == "parallel_wavegan_discriminator":
          model = MyModel(
              in_channels=1,
              out_channels=1,
              kernel_size=3,
              num_layers=c.discriminator_model_params["num_layers"],
              conv_channels=64,
              dilation_factor=1,
              nonlinear_activation="LeakyReLU",
              nonlinear_activation_params={"negative_slope": 0.2},
              bias=True,
          )
      return model
  
file_path: TTS/TTS/vocoder/utils/generic_utils.py
imports: import re
  import torch
  import importlib
  import numpy
  from matplotlib import pyplot
  from TTS.tts.utils.visual import plot_spectrogram
label_desc: Use image node_id 6 for calling a global function with example usage: setup_discriminator(c) and returns: model