Implement the linear variance schedule used in the original DDPM experiments. For T diffusion steps, create equally spaced values from β1 through βT, including both endpoints.
βt=β1+T−1t−1(βT−β1),t=1,…,T.Here, T is the number of diffusion steps and βt is the variance added at step t. When T=1, return [β1]. Return the schedule as a list of Python floats rounded to six decimals.
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.
All steps in DDPM
Accepts: number
Accepts: number
Accepts: number
Noise Schedule
Implement the linear variance schedule used in the original DDPM experiments. For T diffusion steps, create equally spaced values from β1 through βT, including both endpoints.
βt=β1+T−1t−1(βT−β1),t=1,…,T.Here, T is the number of diffusion steps and βt is the variance added at step t. When T=1, return [β1]. Return the schedule as a list of Python floats rounded to six decimals.
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.
All steps in DDPM
Accepts: number
Accepts: number
Accepts: number