A noise schedule decides how fast the forward process destroys an image. The number to watch is the signal remaining after step :
where is the amount of noise added at step . Before any noise is added it is 1, and it falls toward 0 as the steps go on. You will build two schedules with steps each and compare their curves.
Linear. The betas rise in equal increments, from beta_start at step 1 to beta_end at step :
Cosine. Start from the curve
where is a small offset. Each step's beta measures how much that curve drops compared with the step before. It is capped at so that no single step wipes the image out completely:
For both schedules, the signal remaining is the running product of over these betas. For the cosine schedule, that means the capped betas.
Task: write compare_schedules(T, beta_start, beta_end, s, checkpoints). It returns a tuple (linear, cosine). Each list has one entry per step number in checkpoints, in the order given, holding for that schedule at that step.
Once your function passes, put the first example's two lists side by side and look at step 500.