Problems
Loading...
Step 3 of 5
Noise Schedule
Easy

Implement the linear variance schedule used in the original DDPM experiments. For TT diffusion steps, create equally spaced values from β1\beta_1 through βT\beta_T, including both endpoints.

βt=β1+t−1T−1(βT−β1),t=1,…,T.\beta_t = \beta_1 + \frac{t-1}{T-1}(\beta_T-\beta_1), \qquad t=1,\ldots,T.

Here, TT is the number of diffusion steps and βt\beta_t is the variance added at step tt. When T=1T=1, return [β1][\beta_1]. Return the schedule as a list of Python floats rounded to six decimals.

Loading visualization...

Examples

Input: T=5, beta_1=0.0001, beta_T=0.02

Output: [0.0001,0.005075,0.01005,0.015025,0.02]

Explanation: Five equally spaced variance values include both supplied endpoints.

Input: T=4, beta_1=0.001, beta_T=0.01

Output: [0.001,0.004,0.007,0.01]

Input: T=1, beta_1=0.005, beta_T=0.005

Output: [0.005]

Hint 1

np.linspace includes both endpoints by default.

Hint 2

Convert the rounded array to a Python list.

Requirements

  • Use NumPy.
  • Include beta_1 and beta_T as the schedule endpoints when T is greater than one.
  • Produce exactly T beta values.
  • Return a list of Python floats rounded to six decimals.

Constraints

  • T is a positive integer.
  • beta_1 and beta_T are floats strictly between 0 and 1.
  • beta_1 is no greater than beta_T.
  • beta_1 equals beta_T when T is one.