📝 fix some more docstrings

This commit is contained in:
Laureηt 2023-07-27 21:18:49 +02:00
parent 96be7c3307
commit 7bff487a75
Signed by: Laurent
SSH key fingerprint: SHA256:kZEpW8cMJ54PDeCvOhzreNr4FSh6R13CMGH/POoO8DI
2 changed files with 14 additions and 13 deletions

View file

@ -3,7 +3,7 @@ include("Schedulers.jl")
""" """
Denoising Diffusion Probabilistic Models (DDPM) scheduler. Denoising Diffusion Probabilistic Models (DDPM) scheduler.
https://arxiv.org/abs/2006.11239 cf. [[2006.11239] Denoising Diffusion Probabilistic Models](https://arxiv.org/abs/2006).
""" """
struct DDPM{V<:AbstractVector} <: Scheduler struct DDPM{V<:AbstractVector} <: Scheduler
# number of diffusion steps used to train the model. # number of diffusion steps used to train the model.
@ -41,14 +41,15 @@ end
""" """
Remove noise from model output using the backward diffusion process. Remove noise from model output using the backward diffusion process.
Args: ## Input
scheduler (`DDPM`): scheduler object. * scheduler (`DDPM`): scheduler to use
sample (`AbstractArray`): sample to remove noise from, i.e. model_input. * sample (`AbstractArray`): sample to remove noise from, i.e. model_input
model_output (`AbstractArray`): predicted noise from the model. * model_output (`AbstractArray`): predicted noise from the model
timesteps (`AbstractArray`): timesteps to remove noise from. * timesteps (`AbstractArray`): timesteps to remove noise from
Returns: ## Output
`AbstractArray`: denoised model output at the given timestep. * pred_prev_sample (`AbstractArray`): denoised sample at t=t-1
* x_0_pred (`AbstractArray`): denoised sample at t=0
""" """
function step( function step(
scheduler::DDPM, scheduler::DDPM,

View file

@ -4,13 +4,13 @@ abstract type Scheduler end
Add noise to clean data using the forward diffusion process. Add noise to clean data using the forward diffusion process.
## Input ## Input
* scheduler (`Scheduler`): scheduler to use. * scheduler (`Scheduler`): scheduler to use
* clean_data (`AbstractArray`): clean data to add noise to. * clean_data (`AbstractArray`): clean data to add noise to
* noise (`AbstractArray`): noise to add to clean data. * noise (`AbstractArray`): noise to add to clean data
* timesteps (`AbstractArray`): timesteps used to weight the noise. * timesteps (`AbstractArray`): timesteps used to weight the noise
## Output ## Output
* noisy_data (`AbstractArray`): noisy data at the given timesteps. * noisy_data (`AbstractArray`): noisy data at the given timesteps
""" """
function add_noise( function add_noise(
scheduler::Scheduler, scheduler::Scheduler,