class_docstr: CNN Autoencoder model to clean speech signals.
  
  Arguments
  ---------
  kernel_size : int
      Size of the convolutional kernel.
  latent_vae : bool
      Whether or not to convert the autoencoder to a vae
  z_prob : bool
      Whether to remove the latent variable concatenation. Is only applicable if latent_vae is False
code: def __init__(self, kernel_size, latent_vae, z_prob):
      super().__init__()
      self.EncodeLayers = torch.nn.ModuleList()
      self.DecodeLayers = torch.nn.ModuleList()
      self.kernel_size = 5
      self.latent_vae = latent_vae
      self.z_prob = z_prob
      EncoderChannels = [
          1,
          16,
          32,
          32,
          64,
          64,
          128,
          128,
          256,
          256,
          512,
          1024,
      ]
      DecoderChannels = [
          2048,
          1024,
          512,
          512,
          256,
          256,
          128,
          128,
          64,
          64,
          32,
          1,
      ]
  
      # Create encoder and decoder layers.
      for i in range(len(EncoderChannels) - 1):
          if i == len(EncoderChannels) - 2 and self.latent_vae:
              outs = EncoderChannels[i + 1] * 2
          else:
              outs = EncoderChannels[i + 1]
          self.EncodeLayers.append(
              nn.Conv1d(
                  in_channels=EncoderChannels[i],
                  out_channels=outs,
                  kernel_size=kernel_size,
                  stride=2,
                  padding=floor(kernel_size / 2),  # same
              )
          )
  
      for i in range(len(DecoderChannels) - 1):
          if i == 0 and self.latent_vae:
              ins = EncoderChannels[-1 * (i + 1)]
          else:
              ins = EncoderChannels[-1 * (i + 1)] * 2
          self.DecodeLayers.append(
              nn.ConvTranspose1d(
                  in_channels=ins,
                  out_channels=EncoderChannels[-1 * (i + 2)],
                  kernel_size=kernel_size
                  + 1,  # adding one to kernel size makes the dimensions match
                  stride=2,
                  padding=floor(kernel_size / 2),  # same
              )
          )
  
file_path: speechbrain/speechbrain/lobes/models/segan_model.py
imports: import torch
  import torch.nn
  import torch.utils.data
  import torch.nn.functional
  from math import floor
label_desc: Use image node_id 1 to create a new Generator object from inherited base classes: torch.nn with example: obj = Generator(kernel_size, latent_vae, z_prob)