tomodrgn.beta_schedule.get_beta_schedule#
- get_beta_schedule(schedule: float | Literal['a', 'b', 'c', 'd', 'e'], n_iterations: int | None = None) ConstantSchedule | LinearSchedule | CyclicalSchedule [source]#
Return one of several types of beta schedules: Constant, Linear, or Cyclical. Each schedule, when called, returns the beta value from a constant function, linear function, or cyclical function.
- Parameters:
schedule – if type float, the value of the beta to always return via a Constant Schedule; otherwise, return a pre-configured Linear or Cyclical schedule based on the supplied letter.
n_iterations – If using a CyclicalSchedule, define the total number of batches during training (used to set the period of cycles together with n_cycles).
- Returns:
a ConstantSchedule, LinearSchedule, or CyclicalSchedule object which may be called to return the next beta value according to the type of schedule.