<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><aclass="tocitem"href="../schedulers/">Schedulers</a></li><liclass="is-active"><aclass="tocitem"href>Beta Schedules</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"><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/main/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><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="https://arxiv.org/abs/2102.09672">[2102.09672] 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</a></li></ul></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/Laurent2916/Diffusers.jl/blob/de5b6b4b3a17f9afa4734600f089756e101ac77a/src/BetaSchedules/Cosine.jl#L1-L15">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><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="https://arxiv.org/abs/2006.11239">[2006.11239] Denoising Diffusion Probabilistic Models</a></li></ul></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/Laurent2916/Diffusers.jl/blob/de5b6b4b3a17f9afa4734600f089756e101ac77a/src/BetaSchedules/Linear.jl#L1-L14">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 betas 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><strong>Output</strong></p><ul><li><code>β::Vector{Real}</code>: rescaled βₜ values at each timestep t</li></ul><p><strong>References</strong></p><ul><li><ahref="https://arxiv.org/abs/2305.08891">[2305.08891] Rescaling Diffusion Models</a> (Alg. 1)</li></ul></div><aclass="docs-sourcelink"target="_blank"href="https://github.com/Laurent2916/Diffusers.jl/blob/de5b6b4b3a17f9afa4734600f089756e101ac77a/src/BetaSchedules/ZeroSNR.jl#L1-L12">source</a></section></article><articleclass="docstring"><header><aclass="docstring-binding"id="Diffusers.BetaSchedules.scaled_linear_beta_schedule"href="#Diffusers.BetaSchedules.scaled_linear_beta_schedule"><code>Diffusers.BetaSchedules.scaled_linear_beta_schedule</code></a> — <spanclass="docstring-category">Function</span></header><section><div><p>Scaled linear beta schedule.</p><p><strong>Input</strong></p><ul><li><code>T::Int</code>: number of timesteps</li><li><code>β₁::Real=1.0f-4</code>: initial value of β</li><li><code>β₋₁::Real=2.0f-2</code>: final 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</str