class_docstr: DiffWave Model with dilated residual blocks
  
  Arguments
  ---------
  input_channels:
      input mel channels of conv1x1 for conditional vocoding task
  residual_layers:
      number of residual blocks
  residual_channels:
      channels of audio convolution
  dilation_cycle_length:
      dilation cycles of audio convolution
  total_steps:
      total steps of diffusion
  unconditional:
      conditional/unconditional generation
  
  Example
  -------
  >>> from speechbrain.lobes.models.DiffWave import DiffWave
  >>> diffwave = DiffWave(
  ...     input_channels=80,
  ...     residual_layers=30,
  ...     residual_channels=64,
  ...     dilation_cycle_length=10,
  ...     total_steps=50,
  ... )
  >>> noisy_audio = torch.randn(1, 1, 25600)
  >>> timestep = torch.randint(50, (1,))
  >>> input_mel = torch.rand(1, 80, 100)
  >>> predicted_noise = diffwave(noisy_audio, timestep, input_mel)
  >>> predicted_noise.shape
  torch.Size([1, 1, 25600])
class_docstr_tok: ["DiffWave","Model","with","dilated","residual","blocks","Arguments","--","--","--","--","-","input_channels",":","input","mel","channels","of","conv1x1","for","conditional","vocoding","task","residual_layers",":","number","of","residual","blocks","residual_channels",":","channels","of","audio","convolution","dilation_cycle_length",":","dilation","cycles","of","audio","convolution","total_steps",":","total","steps","of","diffusion","unconditional",":","conditional\/unconditional","generation","Example","--","--","--","-",">",">",">","from","speechbrain.lobes.models.DiffWave","import","DiffWave",">",">",">","diffwave","=","DiffWave","(","...","input_channels=80",",","...","residual_layers=30",",","...","residual_channels=64",",","...","dilation_cycle_length=10",",","...","total_steps=50",",","...",")",">",">",">","noisy_audio","=","torch.randn","(","1",",","1",",","25600",")",">",">",">","timestep","=","torch.randint","(","50",",","(","1",",",")",")",">",">",">","input_mel","=","torch.rand","(","1",",","80",",","100",")",">",">",">","predicted_noise","=","diffwave","(","noisy_audio",",","timestep",",","input_mel",")",">",">",">","predicted_noise.shape","torch.Size","(","[","1",",","1",",","25600","]",")"]
code: def __init__(
      self,
      input_channels,
      residual_layers,
      residual_channels,
      dilation_cycle_length,
      total_steps,
      unconditional=False,
  ):
      super().__init__()
      self.input_channels = input_channels
      self.residual_layers = residual_layers
      self.residual_channels = residual_channels
      self.dilation_cycle_length = dilation_cycle_length
      self.unconditional = unconditional
      self.total_steps = total_steps
      self.input_projection = Conv1d(
          in_channels=1,
          out_channels=self.residual_channels,
          kernel_size=1,
          skip_transpose=True,
          padding="same",
          conv_init="kaiming",
      )
      self.diffusion_embedding = DiffusionEmbedding(self.total_steps)
  
      if self.unconditional:  # use unconditional model
          self.spectrogram_upsampler = None
      else:
          self.spectrogram_upsampler = SpectrogramUpsampler()
  
      self.residual_layers = nn.ModuleList(
          [
              ResidualBlock(
                  self.input_channels,
                  self.residual_channels,
                  2 ** (i % self.dilation_cycle_length),
                  uncond=self.unconditional,
              )
              for i in range(self.residual_layers)
          ]
      )
      self.skip_projection = Conv1d(
          in_channels=self.residual_channels,
          out_channels=self.residual_channels,
          kernel_size=1,
          skip_transpose=True,
          padding="same",
          conv_init="kaiming",
      )
      self.output_projection = Conv1d(
          in_channels=self.residual_channels,
          out_channels=1,
          kernel_size=1,
          skip_transpose=True,
          padding="same",
          conv_init="zero",
      )
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from speechbrain.nnet.CNN import Conv1d
  from speechbrain.nnet import linear
  from speechbrain.nnet.diffusion import DenoisingDiffusion
  from math import sqrt
  from torchaudio import transforms
label_desc: Use image node_id 1 to create a new DiffWave object from inherited base classes: nn with example: obj = DiffWave(input_channels, residual_layers, residual_channels, dilation_cycle_length, total_steps, unconditional)