code: def betas_from_linear_variance(steps, variance, max_beta=0.999):
      alpha_bar = 1 - variance
      betas = []
      betas.append(1 - alpha_bar[0])
      for i in range(1, steps):
          betas.append(
              min(1 - alpha_bar[i] / alpha_bar[i - 1], max_beta)
          )
      return np.array(betas)
  
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 1 for calling a global function with example usage: betas_from_linear_variance(steps, variance, max_beta) and returns: np