helena 0.1.0

Core types and component interfaces for helena, a latent data-to-waveform generation platform.
Documentation
//! Variance-preserving diffusion parameterization for continuous latents.
//!
//! The gradient-flow review
//! (`docs/lit-review/objective-gradient-flow-frozen-codec-conditional-prior.md`)
//! and the target architecture (`docs/target_arch/conditional-generator.adoc`)
//! require a standardized latent diffusion prior with a v-prediction objective.
//! This module keeps the numeric core small, total, and backend agnostic so the
//! trainer and sampler share one set of identities.
//!
//! A [`NoiseLevel`] stores only the signal variance `gamma = signal^2` in
//! `[0, 1]`; the VP invariant `signal^2 + noise^2 = 1` is derived, not caller
//! convention. [`CosineSchedule`] maps normalized time to those levels along the
//! Nichol and Dhariwal cosine path. [`LogitNormalDensity`] biases where a trainer
//! draws that time, concentrating mass on the mid-SNR band a few-step sampler
//! traverses coarsely. [`GuidanceSchedule`] biases where the sampler applies
//! classifier-free guidance across that same band.
//!
//! This module is the workspace's correct-by-construction template: the levers
//! are validated newtypes with fail-closed serde gates, the numeric identities
//! are total functions over the single `gamma` coordinate, and the tests the
//! trainer and sampler share pin the contract. It operates on the raw host-side
//! [`Tensor`](crate::Tensor) carrier — the diffusion math is kind-agnostic
//! elementwise arithmetic, so it predates the [`FrameSeq`](crate::FrameSeq)
//! wrapper the pipeline puts around continuous latents.
//!
//! See the `mod.adoc` design note in this directory for the rationale: the single
//! `gamma` coordinate, the v-prediction choice, why the three levers stay
//! independent, and the deferred x0 and EDM-sigma decisions.

mod density;
mod guidance;
mod level;
mod ops;
mod schedule;

pub use density::LogitNormalDensity;
pub use guidance::{GuidanceInterval, GuidanceSchedule};
pub use level::{MinSnrGamma, NoiseLevel};
pub use schedule::CosineSchedule;

#[cfg(test)]
mod tests;