From 4122a47b6d6577f9e96ffd90d62f90893a8fdf55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laure=CE=B7t?= Date: Tue, 25 Jul 2023 20:11:48 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20move=20add=5Fnoise=20docstring?= =?UTF-8?q?=20in=20Schedulers.jl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Schedulers.jl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Schedulers.jl b/src/Schedulers.jl index 1ba7869..35ef409 100644 --- a/src/Schedulers.jl +++ b/src/Schedulers.jl @@ -1,23 +1,23 @@ abstract type Scheduler end +""" +Add noise to clean data using the forward diffusion process. + +## Input + * scheduler (`Scheduler`): scheduler object. + * 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. + +## Output + * noisy_data (`AbstractArray`): noisy data at the given timesteps. +""" function add_noise( scheduler::Scheduler, clean_data::AbstractArray, noise::AbstractArray, timesteps::AbstractArray, ) - """ - Add noise to clean data using the forward diffusion process. - - Args: - scheduler (`Scheduler`): scheduler object. - 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. - - Returns: - `AbstractArray`: noisy data at the given timesteps. - """ sqrt_α_cumprod_t = scheduler.sqrt_α_cumprods[timesteps] sqrt_one_minus_α_cumprod_t = scheduler.sqrt_one_minus_α_cumprods[timesteps]