class_docstr: A base diffusion implementation
  
  Arguments
  ---------
  model: nn.Module
      the underlying model
  timesteps: int
      the number of timesteps
  noise: callable|str
      the noise function/module to use
  
      The following predefined types of noise are provided
      "gaussian": Gaussian noise, applied to the whole sample
      "length_masked_gaussian": Gaussian noise applied only
          to the parts of the sample that is not padding
code: def __init__(self, model, timesteps, noise=None):
      super().__init__()
      self.model = model
      self.timesteps = timesteps
      if noise is None:
          noise = "gaussian"
      if isinstance(noise, str):
          self.noise = _NOISE_FUNCTIONS[noise]()
      else:
          self.noise = noise
  
imports: from collections import namedtuple
  import torch
  from torch import nn
  from torch.nn import functional
  from tqdm.auto import tqdm
  from speechbrain.utils.data_utils import unsqueeze_as
  from speechbrain.dataio.dataio import length_to_mask
  from speechbrain.utils import data_utils
label_desc: Use image node_id 1 to create a new Diffuser object from inherited base classes: nn with example: obj = Diffuser(model, timesteps, noise)