class_docstr: DiffRec is a generative recommender model which infers users' interaction probabilities in a denoising manner.
  Note that DiffRec simultaneously ranks all items for each user.
  We implement the the DiffRec model with only user dataloader.
class_docstr_tok: ["DiffRec","is","a","generative","recommender","model","which","infers","users","'","interaction","probabilities","in","a","denoising","manner",".","Note","that","DiffRec","simultaneously","ranks","all","items","for","each","user",".","We","implement","the","the","DiffRec","model","with","only","user","dataloader","."]
docstr: Given the schedule name, create the betas for the diffusion process.
code: def get_betas(self):
      r"""
      Given the schedule name, create the betas for the diffusion process.
      """
      if (
          self.noise_schedule == "linear"
          or self.noise_schedule == "linear-var"
      ):
          start = self.noise_scale * self.noise_min
          end = self.noise_scale * self.noise_max
          if self.noise_schedule == "linear":
              return np.linspace(
                  start, end, self.steps, dtype=np.float64
              )
          else:
              return betas_from_linear_variance(
                  self.steps,
                  np.linspace(start, end, self.steps, dtype=np.float64),
              )
      elif self.noise_schedule == "cosine":
          return betas_for_alpha_bar(
              self.steps,
              lambda t: math.cos((t + 0.008) / 1.008 * math.pi / 2)
              ** 2,
          )
      # Deep Unsupervised Learning using Noneequilibrium Thermodynamics 2.4.1
      elif self.noise_schedule == "binomial":
          ts = np.arange(self.steps)
          betas = [1 / (self.steps - t + 1) for t in ts]
          return betas
      else:
          raise NotImplementedError(
              f"unknown beta schedule: {self.noise_schedule}!"
          )
  
imports: import enum
  import math
  import copy
  import numpy
  import torch
  import torch.nn.functional
  import torch.nn
  from recbole.model.init import xavier_normal_initialization
  from recbole.utils.enum_type import InputType
  from recbole.model.abstract_recommender import AutoEncoderMixin, GeneralRecommender
  from recbole.model.layers import MLPLayers
  import typing
label_desc: Use image node_id 3 for calling the DiffRec obj's underlying member method code with example usage: obj.get_betas() and returns: np, betas_from_linear_variance, betas_for_alpha_bar, betas