Jump to content

File:Linear diffusion noise scheduler.svg

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file (SVG file, nominally 614 × 461 pixels, file size: 30 KB)

Summary

Description
English: Illustration for a linear diffusion noise schedule. With settings .

Matplotlib code

import 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


)

plt.savefig("diffusion_schedulers.svg")
Source Own work Edit this at Structured Data on Commons
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:
w:en:Creative Commons
attribution share alike
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.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

image/svg+xml

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current23:11, 7 September 2024Thumbnail for version as of 23:11, 7 September 2024614 × 461 (30 KB)Cosmia NebulaUploaded while editing "Diffusion model" on wiki.riteme.site

The following page uses this file:

Metadata