mirror of
https://github.com/Laurent2916/Diffusers.jl.git
synced 2024-11-09 15:02:02 +00:00
📝 (Schedulers) fix non matching docstrings
This commit is contained in:
parent
4dfa3c92dc
commit
708e082874
|
@ -3,16 +3,14 @@ abstract type Scheduler end
|
||||||
"""
|
"""
|
||||||
Add noise to clean data using the forward diffusion process.
|
Add noise to clean data using the forward diffusion process.
|
||||||
|
|
||||||
cf. [[2006.11239] Denoising Diffusion Probabilistic Models](https://arxiv.org/abs/2006.11239) (Eq. 4)
|
|
||||||
|
|
||||||
## Input
|
## Input
|
||||||
* `scheduler::Scheduler`: scheduler to use
|
* `scheduler::Scheduler`: scheduler to use
|
||||||
* `clean_data::AbstractArray`: clean data to add noise to
|
* `x₀::AbstractArray`: clean data to add noise to
|
||||||
* `noise::AbstractArray`: noise to add to clean data
|
* `ϵ::AbstractArray`: noise to add to clean data
|
||||||
* `timesteps::AbstractArray`: timesteps used to weight the noise
|
* `t::AbstractArray`: timesteps used to weight the noise
|
||||||
|
|
||||||
## Output
|
## Output
|
||||||
* `noisy_data::AbstractArray`: noisy data at the given timesteps
|
* `xₜ::AbstractArray`: noisy data at the given timesteps
|
||||||
"""
|
"""
|
||||||
function add_noise(
|
function add_noise(
|
||||||
scheduler::Scheduler,
|
scheduler::Scheduler,
|
||||||
|
@ -23,6 +21,8 @@ function add_noise(
|
||||||
⎷α̅ₜ = scheduler.⎷α̅[t]
|
⎷α̅ₜ = scheduler.⎷α̅[t]
|
||||||
⎷β̅ₜ = scheduler.⎷β̅[t]
|
⎷β̅ₜ = scheduler.⎷β̅[t]
|
||||||
|
|
||||||
|
# noisify clean data
|
||||||
|
# arxiv:2006.11239 Eq. 4
|
||||||
xₜ = ⎷α̅ₜ' .* x₀ + ⎷β̅ₜ' .* ϵ
|
xₜ = ⎷α̅ₜ' .* x₀ + ⎷β̅ₜ' .* ϵ
|
||||||
|
|
||||||
return xₜ
|
return xₜ
|
||||||
|
|
Loading…
Reference in a new issue