diff --git a/src/Schedulers.jl b/src/Schedulers.jl index b78539b..1a1abe4 100644 --- a/src/Schedulers.jl +++ b/src/Schedulers.jl @@ -3,16 +3,14 @@ abstract type Scheduler end """ 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 * `scheduler::Scheduler`: scheduler to use - * `clean_data::AbstractArray`: clean data to add noise to - * `noise::AbstractArray`: noise to add to clean data - * `timesteps::AbstractArray`: timesteps used to weight the noise + * `x₀::AbstractArray`: clean data to add noise to + * `ϵ::AbstractArray`: noise to add to clean data + * `t::AbstractArray`: timesteps used to weight the noise ## Output - * `noisy_data::AbstractArray`: noisy data at the given timesteps + * `xₜ::AbstractArray`: noisy data at the given timesteps """ function add_noise( scheduler::Scheduler, @@ -23,6 +21,8 @@ function add_noise( ⎷α̅ₜ = scheduler.⎷α̅[t] ⎷β̅ₜ = scheduler.⎷β̅[t] + # noisify clean data + # arxiv:2006.11239 Eq. 4 xₜ = ⎷α̅ₜ' .* x₀ + ⎷β̅ₜ' .* ϵ return xₜ