📝 (Schedulers) fix non matching docstrings

This commit is contained in:
Laureηt 2023-07-29 15:51:13 +02:00
parent 4dfa3c92dc
commit 708e082874
Signed by: Laurent
SSH key fingerprint: SHA256:kZEpW8cMJ54PDeCvOhzreNr4FSh6R13CMGH/POoO8DI

View file

@ -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ₜ