SCottModel<T>
Models & Types · AiDotNet.Diffusion.FastGeneration
SCott (Score Consistency via Optimal Transport) for efficient single/few-step generation.
Inheritance: DiffusionModelBase<T> → LatentDiffusionModelBase<T> → SCottModel<T>
For Beginners
SCott finds the most efficient path from noise to images using optimal transport theory (the math of moving mass efficiently). Like finding the shortest route for delivery trucks, SCott finds the shortest path from random noise to your desired image, enabling generation in just 1-4 steps.
How It Works
SCott combines score-based consistency training with optimal transport theory to learn efficient single-step mappings. Uses a score-matching objective regularized by an optimal transport penalty to produce straight transport paths that are well-suited for few-step generation.
Reference: “SCott: Accelerating Diffusion Models with Stochastic Consistency Distillation”, 2024
Example
var options = new DiffusionModelOptions<float> { LatentChannels = 4, DefaultInferenceSteps = 2 };
var noise = Tensor<float>.CreateRandom(new[] { 1, 4, 64, 64 });
var trainX = Tensor<float>.CreateRandom(4, 8);
var trainY = Tensor<float>.CreateRandom(4, 2);
var result = new AiModelBuilder<float, Tensor<float>, Tensor<float>>()
.ConfigureModel(new SCottModel<float>(options: options))
.Build(trainX, trainY);
var generated = result.Predict(noise);
Constructors
| Constructor | Summary |
|---|---|
SCottModel(NeuralNetworkArchitecture<T> architecture, DiffusionModelOptions<T> options, INoiseScheduler<T> scheduler, UNetNoisePredictor<T> predictor, StandardVAE<T> vae, IConditioningModule<T> conditioner, int? seed) |
Initializes a new SCott model. |
Properties
| Property | Summary |
|---|---|
IConditioningModule<T> Conditioner { get; } |
|
INoisePredictor<T> NoisePredictor { get; } |
|
IVAEModel<T> VAE { get; } |
|
int LatentChannels { get; } |
Methods
| Method | Summary |
|---|---|
ModelMetadata<T> GetModelMetadata() |