class_docstr: Noise schedule for diffusion.
  
  Args:
      beta_t0 (float): Variance of the first diffusion step.
      beta_t1 (float): Variance of the last diffusion step.
      beta_exp (float): Power schedule exponent
      num_steps (int): Number of diffusion step.
      variance (str): choice of the sigma value for the denoising eq. Choices: "beta" or "beta_tilde"
      clip (float): clipping value for the denoising steps
      rescale (float): rescaling value to avoid vanishing signals unused by default (i.e 1)
      repartition (str): shape of the schedule only power schedule is supported
      sample_processor (SampleProcessor): Module that normalize data to match better the gaussian distribution
      noise_scale (float): Scaling factor for the noise
class_docstr_tok: ["Noise","schedule","for","diffusion",".","Args",":","beta_t0","(","float",")",":","Variance","of","the","first","diffusion","step",".","beta_t1","(","float",")",":","Variance","of","the","last","diffusion","step",".","beta_exp","(","float",")",":","Power","schedule","exponent","num_steps","(","int",")",":","Number","of","diffusion","step",".","variance","(","str",")",":","choice","of","the","sigma","value","for","the","denoising","eq",".","Choices",":","``","beta","''","or","``","beta_tilde","''","clip","(","float",")",":","clipping","value","for","the","denoising","steps","rescale","(","float",")",":","rescaling","value","to","avoid","vanishing","signals","unused","by","default","(","i.e","1",")","repartition","(","str",")",":","shape","of","the","schedule","only","power","schedule","is","supported","sample_processor","(","SampleProcessor",")",":","Module","that","normalize","data","to","match","better","the","gaussian","distribution","noise_scale","(","float",")",":","Scaling","factor","for","the","noise"]
docstr: Create a noisy data item for diffusion model training:
  
  Args:
      x (torch.Tensor): clean audio data torch.tensor(bs, 1, T)
      tensor_step (bool): If tensor_step = false, only one step t is sample,
          the whole batch is diffused to the same step and t is int.
          If tensor_step = true, t is a tensor of size (x.size(0),)
          every element of the batch is diffused to a independently sampled.
docstr_tok: ["Create","a","noisy","data","item","for","diffusion","model","training",":","Args",":","x","(","torch.Tensor",")",":","clean","audio","data","torch.tensor","(","bs",",","1",",","T",")","tensor_step","(","bool",")",":","If","tensor_step","=","false",",","only","one","step","t","is","sample",",","the","whole","batch","is","diffused","to","the","same","step","and","t","is","int",".","If","tensor_step","=","true",",","t","is","a","tensor","of","size","(","x.size","(","0",")",",",")","every","element","of","the","batch","is","diffused","to","a","independently","sampled","."]
code: def get_training_item(
      self, x: torch.Tensor, tensor_step: bool = False
  ) -> TrainingItem:
      """Create a noisy data item for diffusion model training:
  
      Args:
          x (torch.Tensor): clean audio data torch.tensor(bs, 1, T)
          tensor_step (bool): If tensor_step = false, only one step t is sample,
              the whole batch is diffused to the same step and t is int.
              If tensor_step = true, t is a tensor of size (x.size(0),)
              every element of the batch is diffused to a independently sampled.
      """
      step: tp.Union[int, torch.Tensor]
      if tensor_step:
          bs = x.size(0)
          step = torch.randint(
              0, self.num_steps, size=(bs,), device=x.device
          )
      else:
          step = self.rng.randrange(self.num_steps)
      alpha_bar = self.get_alpha_bar(step)  # [batch_size, n_bands, 1]
  
      x = self.sample_processor.project_sample(x)
      noise = torch.randn_like(x)
      noisy = (alpha_bar.sqrt() / self.rescale) * x + (
          1 - alpha_bar
      ).sqrt() * noise * self.noise_scale
      return TrainingItem(noisy, noise, step)
  
imports: from collections import namedtuple
  import random
  import typing
  import julius
  import torch
label_desc: Use image node_id 5 for calling the NoiseSchedule obj's underlying member method code with example usage: obj.get_training_item(x, tensor_step) and returns: TrainingItem