<htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device-width, initial-scale=1.0"/><title>Beta Schedules · Diffusers.jl</title><scriptdata-outdated-warnersrc="../assets/warner.js"></script><linkhref="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css"rel="stylesheet"type="text/css"/><script>documenterBaseURL=".."</script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"data-main="../assets/documenter.js"></script><scriptsrc="../siteinfo.js"></script><scriptsrc="../../versions.js"></script><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-dark.css"data-theme-name="documenter-dark"data-theme-primary-dark/><linkclass="docs-theme-link"rel="stylesheet"type="text/css"href="../assets/themes/documenter-light.css"data-theme-name="documenter-light"data-theme-primary/><scriptsrc="../assets/themeswap.js"></script></head><body><divid="documenter"><navclass="docs-sidebar"><divclass="docs-package-name"><spanclass="docs-autofit"><ahref="../">Diffusers.jl</a></span></div><formclass="docs-search"action="../search/"><inputclass="docs-search-query"id="documenter-search-query"name="q"type="text"placeholder="Search docs"/></form><ulclass="docs-menu"><li><aclass="tocitem"href="../">Home</a></li><li><spanclass="tocitem">API</span><ul><li><aclass="tocitem"href="../schedulers/">Schedulers</a></li><liclass="is-active"><aclass="tocitem"href>Beta Schedules</a></li></ul></li><li><spanclass="tocitem">Examples</span><ul><li><aclass="tocitem"href="../generated/beta_schedulers_comparison/">Beta Schedules Comparison</a></li></ul></li><li><aclass="tocitem"href="../references/">References</a></li></ul><divclass="docs-version-selector field has-addons"><divclass="control"><spanclass="docs-label button is-static is-size-7">Version</span></div><divclass="docs-selector control is-expanded"><divclass="select is-fullwidth is-size-7"><selectid="documenter-version-selector"></select></div></div></div></nav><divclass="docs-main"><headerclass="docs-navbar"><navclass="breadcrumb"><ulclass="is-hidden-mobile"><li><aclass="is-disabled">API</a></li><liclass="is-active"><ahref>Beta Schedules</a></li></ul><ulclass="is-hidden-tablet"><liclass="is-active"><ahref>Beta Schedules</a></li></ul></nav><divclass="docs-right"><aclass="docs-edit-link"href="https://github.com/Laurent2916/Diffusers.jl/blob/master/docs/src/beta_schedules.md#"title="Edit on GitHub"><spanclass="docs-icon fab"></span><spanclass="docs-label is-hidden-touch">Edit on GitHub</span></a><aclass="docs-settings-button fas fa-cog"id="documenter-settings-button"href="#"title="Settings"></a><aclass="docs-sidebar-button fa fa-bars is-hidden-desktop"id="documenter-sidebar-button"href="#"></a></div></header><articleclass="content"id="documenter-page"><objecttype="text/html"data="beta_schedules.html"style="width:100%;height:420px;"></object>
<objecttype="text/html"data="alpha_bar_schedules.html"style="width:100%;height:420px;"></object><articleclass="docstring"><header><aclass="docstring-binding"id="Diffusers.BetaSchedules.cosine_beta_schedule"href="#Diffusers.BetaSchedules.cosine_beta_schedule"><code>Diffusers.BetaSchedules.cosine_beta_schedule</code></a> — <spanclass="docstring-category">Function</span></header><section><div><p>Cosine beta schedule.</p><pclass="math-container">\[\overline{\alpha}_t = \cos \left( \frac{t / T + \epsilon}{1 + \epsilon} \frac{\pi}{2} \right)\]</p><p><strong>Input</strong></p><ul><li><code>T::Int</code>: number of timesteps</li><li><code>βₘₐₓ::Real=0.999f0</code>: maximum value of β</li><li><code>ϵ::Real=1.0f-3</code>: small value used to avoid division by zero</li></ul><p><strong>Output</strong></p><ul><li><code>β::Vector{Real}</code>: βₜ values at each timestep t</li></ul><p><strong>References</strong></p><ul><li><ahref="../references/#nichol2021improved">[2, Improved Denoising Diffusion Probabilistic Models]</a></li><li><ahref="https://github.com/openai/improved-diffusion/blob/783b6740edb79fdb7d063250db2c51cc9545dcd1/improved_diffusion/gaussian_diffusion.py#L36">github:openai/improved-diffusion/improved<em>diffusion/gaussian</em>diffusion.py</a></li></ul></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/Laurent2916/Diffusers.jl/blob/1a317e470372442791625722f64b30b5e3d9e28f/src/BetaSchedules/Cosine.jl#L1-L19">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="Diffusers.BetaSchedules.exponential_beta_schedule"href="#Diffusers.BetaSchedules.exponential_beta_schedule"><code>Diffusers.BetaSchedules.exponential_beta_schedule</code></a> — <spanclass="docstring-category">Function</span></header><section><div><p>Exponential beta schedule.</p><pclass="math-container">\[\overline{\alpha}_t = \exp \left( \frac{-12 t}{T} \right)\]</p><p><strong>Input</strong></p><ul><li><code>T::Int</code>: number of timesteps</li><li><code>βₘₐₓ::Real=0.999f0</code>: maximum value of β</li></ul><p><strong>Output</strong></p><ul><li><code>β::Vector{Real}</code>: βₜ values at each timestep t</li></ul></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/Laurent2916/Diffusers.jl/blob/1a317e470372442791625722f64b30b5e3d9e28f/src/BetaSchedules/Exponential.jl#L1-L14">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="Diffusers.BetaSchedules.linear_beta_schedule"href="#Diffusers.BetaSchedules.linear_beta_schedule"><code>Diffusers.BetaSchedules.linear_beta_schedule</code></a> — <spanclass="docstring-category">Function</span></header><section><div><p>Linear beta schedule.</p><pclass="math-container">\[\beta_t = \beta_1 + \frac{t - 1}{T - 1} (\beta_{-1} - \beta_1)\]</p><p><strong>Input</strong></p><ul><li><code>T::Integer</code>: number of timesteps</li><li><code>β₁::Real=1.0f-4</code>: initial (t=1) value of β</li><li><code>β₋₁::Real=2.0f-2</code>: final (t=T) value of β</li></ul><p><strong>Output</strong></p><ul><li><code>β::Vector{Real}</code>: βₜ values at each timestep t</li></ul><p><strong>References</strong></p><ul><li><ahref="../references/#ho2020denoising">[3, Denoising Diffusion Probabilistic Models]</a></li></ul></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/Laurent2916/Diffusers.jl/blob/1a317e470372442791625722f64b30b5e3d9e28f/src/BetaSchedules/Linear.jl#L1-L18">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="Diffusers.BetaSchedules.rescale_zero_terminal_snr-Tuple{AbstractArray}"href="#Diffusers.BetaSchedules.rescale_zero_terminal_snr-Tuple{AbstractArray}"><code>Diffusers.BetaSchedules.rescale_zero_terminal_snr</code></a> — <spanclass="docstring-category">Method</span></header><section><div><p>Rescale β to have zero terminal Signal to Noise Ratio (SNR).</p><p><strong>Input</strong></p><ul><li><code>β::AbstractArray</code>: βₜ values at each timestep t</li></ul><p><stron