TrajectoryConsistencyDistiller<T>

Models & Types · AiDotNet.Diffusion.Distillation

Trainer for Trajectory Consistency Distillation (TCD) with trajectory-aware loss.

For Beginners

Standard consistency distillation checks if the student gets the right answer at each individual step. TCD also checks if the student’s answers are consistent with each other across the whole journey — like checking that a student’s essay tells a coherent story, not just that each sentence is correct.

How It Works

TCD extends standard consistency distillation by considering the entire ODE trajectory rather than individual timestep pairs. The trajectory-aware loss ensures the student is self-consistent across the entire denoising path, producing higher quality at any step count.

Reference: Zheng et al., “Trajectory Consistency Distillation”, 2024

Constructors

Constructor Summary
TrajectoryConsistencyDistiller(IDiffusionModel<T> teacher, double emaDecay, double stochasticEta) Initializes a new TCD trainer.

Properties

Property Summary
IDiffusionModel<T> Teacher { get; } Gets the teacher model.
double EMADecay { get; } Gets the EMA decay rate.
double StochasticEta { get; } Gets the stochastic noise injection strength.

Methods

Method Summary
T ComputeTrajectoryLoss(Vector<T>[] studentOutputs, Vector<T>[] targetOutputs) Computes the trajectory consistency loss across multiple timestep pairs.