🎨 AIRA Generative Diffusion Models (ai/diffusion)
Provides native implementations of Denoising Diffusion Probabilistic Models (DDPM) and noise schedules for generative image, audio, and tensor synthesis.
🌊 Diffusion Mechanics in AIRA
- Forward Noise Schedule: Adds Gaussian noise over
Ttimesteps according to variance scheduleeta_1, \dots, eta_T:q(x_t | x_0) = \mathcal{N}(x_t; \sqrt{ar{lpha}_t} x_0, (1 - ar{lpha}_t)\mathbf{I}) - Reverse Denoising Process: The neural network predicts the noise
\epsilon_ heta(x_t, t)to iteratively reconstruct clean latent datax_0.
import "ai/diffusion";
let scheduler = new DDPMScheduler(timesteps=1000, beta_start=0.0001, beta_end=0.02);
let noisy_sample = scheduler.add_noise(clean_latent, noise, timestep=500);