File:Linear diffusion noise scheduler.svg
Summary
| Description |
English: Illustration for a linear diffusion noise schedule. With settings .
Matplotlibimport numpy as np
import matplotlib.pyplot as plt
class Scheduler:
def __init__(self, beta_start=1e-4, beta_end=2e-2, num_train_timesteps=1000):
self.beta_start = beta_start
self.beta_end = beta_end
self.num_train_timesteps = num_train_timesteps
self.betas = np.linspace(self.beta_start, self.beta_end, self.num_train_timesteps)
self.alphas = 1.0 - self.betas
self.alphas_cumprod = np.cumprod(self.alphas, axis=0)
sch = Scheduler(beta_start=1e-4, beta_end=2e-2, num_train_timesteps=1000)
plt.plot([sch.alphas[t] for t in range(sch.num_train_timesteps)], label=r"$\alpha_t = 1 - \beta_t$")
plt.plot([sch.alphas_cumprod[t] for t in range(sch.num_train_timesteps)], label=r"$\bar\alpha_t$")
plt.plot([np.sqrt(1 - sch.alphas_cumprod[t]) for t in range(sch.num_train_timesteps)], label=r"$\sigma_t = \sqrt[[:Template:1 - \bar\alpha t]]$")
plt.plot([sch.betas[t] for t in range(sch.num_train_timesteps)], label=r"$\beta_t$")
plt.legend()
plt.yscale('log')
plt.xlabel(f'$t |
| Source | Own work |
| Author |
|date=2024-09-07 |source=Own work |author=Cosmia Nebula }}
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:All media needing categories as of 2024
Category:CC-BY-SA-4.0
Category:Created with Matplotlib
Category:Files with no machine-readable author
Category:Media lacking author information
Category:Media needing categories as of 7 September 2024
Category:Pages with syntax highlighting errors
Category:Self-published work