mirror of
https://github.com/Laurent2916/Diffusers.jl.git
synced 2024-09-18 18:45:28 +00:00
🩹 move add_noise docstring in Schedulers.jl
This commit is contained in:
parent
b4ed6e3c99
commit
4122a47b6d
|
@ -1,23 +1,23 @@
|
||||||
abstract type Scheduler end
|
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(
|
function add_noise(
|
||||||
scheduler::Scheduler,
|
scheduler::Scheduler,
|
||||||
clean_data::AbstractArray,
|
clean_data::AbstractArray,
|
||||||
noise::AbstractArray,
|
noise::AbstractArray,
|
||||||
timesteps::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_α_cumprod_t = scheduler.sqrt_α_cumprods[timesteps]
|
||||||
sqrt_one_minus_α_cumprod_t = scheduler.sqrt_one_minus_α_cumprods[timesteps]
|
sqrt_one_minus_α_cumprod_t = scheduler.sqrt_one_minus_α_cumprods[timesteps]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue