Diffusers.jl/dev/beta_schedules/index.html

4 lines
9.9 KiB
HTML
Raw Normal View History

2023-08-04 20:46:30 +00:00
<!DOCTYPE html>
2023-08-05 10:35:33 +00:00
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Beta Schedules · Diffusers.jl</title><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">Diffusers.jl</a></span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../schedulers/">Schedulers</a></li><li class="is-active"><a class="tocitem" href>Beta Schedules</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Beta Schedules</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Beta Schedules</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/Laurent2916/Diffusers.jl/blob/main/docs/src/beta_schedules.md#" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><object type="text/html" data="beta_schedules.html" style="width:100%;height:420px;"></object>
2023-08-07 18:56:10 +00:00
<object type="text/html" data="alpha_bar_schedules.html" style="width:100%;height:420px;"></object><article class="docstring"><header><a class="docstring-binding" id="Diffusers.BetaSchedules.cosine_beta_schedule" href="#Diffusers.BetaSchedules.cosine_beta_schedule"><code>Diffusers.BetaSchedules.cosine_beta_schedule</code></a><span class="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><a href="https://arxiv.org/abs/2102.09672">[2102.09672] Improved Denoising Diffusion Probabilistic Models</a></li><li><a href="https://github.com/openai/improved-diffusion/blob/783b6740edb79fdb7d063250db2c51cc9545dcd1/improved_diffusion/gaussian_diffusion.py#L36">github:openai/improved-diffusion</a></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/Laurent2916/Diffusers.jl/blob/77961913ba5c623ca3bd7cf7603e10d12349e3f7/src/BetaSchedules/Cosine.jl#L1-L15">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Diffusers.BetaSchedules.linear_beta_schedule" href="#Diffusers.BetaSchedules.linear_beta_schedule"><code>Diffusers.BetaSchedules.linear_beta_schedule</code></a><span class="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><a href="https://arxiv.org/abs/2006.11239">[2006.11239] Denoising Diffusion Probabilistic Models</a></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/Laurent2916/Diffusers.jl/blob/77961913ba5c623ca3bd7cf7603e10d12349e3f7/src/BetaSchedules/Linear.jl#L1-L14">source</a></section></article><article class="docstring"><header><a class="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><span class="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><a href="https://arxiv.org/abs/2305.08891">[2305.08891] Rescaling Diffusion Models</a> (Alg. 1)</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/Laurent2916/Diffusers.jl/blob/77961913ba5c623ca3bd7cf7603e10d12349e3f7/src/BetaSchedules/ZeroSNR.jl#L1-L12">source</a></section></article><article class="docstring"><header><a class="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><span class="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