class_docstr: Spectogram Denoiser.
  
  Ref: https://arxiv.org/pdf/2207.06389.pdf.
docstr: Calculate forward for denoising diffusion.
  
  Args:
      xs_noisy (torch.Tensor): Input tensor.
      step (torch.Tensor): Number of step.
      condition (torch.Tensor): Conditioning tensor.
  
  Returns:
      torch.Tensor: Denoised tensor.
docstr_tok: ["Calculate","forward","for","denoising","diffusion",".","Args",":","xs_noisy","(","torch.Tensor",")",":","Input","tensor",".","step","(","torch.Tensor",")",":","Number","of","step",".","condition","(","torch.Tensor",")",":","Conditioning","tensor",".","Returns",":","torch.Tensor",":","Denoised","tensor","."]
code: def forward_denoise(
      self,
      xs_noisy: torch.Tensor,
      step: torch.Tensor,
      condition: torch.Tensor,
  ) -> torch.Tensor:
      """Calculate forward for denoising diffusion.
  
      Args:
          xs_noisy (torch.Tensor): Input tensor.
          step (torch.Tensor): Number of step.
          condition (torch.Tensor): Conditioning tensor.
  
      Returns:
          torch.Tensor: Denoised tensor.
  
      """
      xs_noisy = xs_noisy.squeeze(1)
      condition = condition.transpose(1, 2)
      xs_noisy = F.relu(self.in_proj(xs_noisy))
  
      step = step.unsqueeze(-1).expand(-1, self.channels)
      step = self.denoiser_pos(step.unsqueeze(1)).squeeze(1)
      step = self.denoiser_mlp(step)
  
      skip_conns = list()
      for _, layer in enumerate(self.denoiser_res):
          xs_noisy, skip = layer(xs_noisy, condition, step)
          skip_conns.append(skip)
  
      xs_noisy = torch.sum(torch.stack(skip_conns), dim=0) / math.sqrt(
          self.num_layers
      )
      xs_denoise = F.relu(self.skip_proj(xs_noisy))
      xs_denoise = self.feats_out(xs_noisy)
      return xs_denoise
  
imports: import math
  from typing import Optional, Union
  import numpy
  import torch
  from torch import nn
  from torch.nn import functional
  from espnet.nets.pytorch_backend.transformer.embedding import PositionalEncoding
label_desc: Use image node_id 3 for calling the SpectogramDenoiser obj's underlying member method code with example usage: obj.forward_denoise(xs_noisy, step, condition) and returns: xs_denoise