DiffusionModelOptions<T>

Options & Configuration · AiDotNet.Models.Options

Configuration options for diffusion-based generative models.

Inheritance: ModelOptions → DiffusionModelOptions<T>

Known derived types: PixArtOptions<T>

For Beginners

Diffusion models work by learning to reverse a gradual noising process. These options control how the model trains and generates samples:

  • LearningRate: How big of a step to take during training
  • TrainTimesteps: How many noise levels to use (more = finer control)
  • BetaStart/BetaEnd: How much noise at each step

How It Works

This options class provides configuration for all diffusion model parameters including training hyperparameters, scheduler configuration, and generation settings.

Constructors

Constructor Summary
DiffusionModelOptions() Initializes a new instance with default values.
DiffusionModelOptions(DiffusionModelOptions<T> other) Initializes a new instance by copying from another instance.

Properties

Property Summary
BetaSchedule BetaSchedule { get; set; } Gets or sets the type of beta schedule to use.
DiffusionPredictionType PredictionType { get; set; } Gets or sets what the model is trained to predict.
DiffusionTrainingSampleSpace TrainingSampleSpace { get; set; } Gets or sets what a latent diffusion model’s training sample is: an image to encode, or a latent.
Func<IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>>> OptimizerFactory { get; set; } Gets or sets the factory used to create the gradient-based optimizer for training updates.
ILossFunction<T> LossFunction { get; set; } Gets or sets the loss function for training.
bool ClipSample { get; set; } Gets or sets whether to clip predicted samples to [-1, 1].
bool UseGpuExecutionGraph { get; set; } Gets or sets whether each synchronous denoising-step noise prediction runs inside a GPU deferred execution graph (device-resident, fused, multi-stream) instead of eager per-op dispatch.
double BetaEnd { get; set; } Gets or sets the ending beta value (noise variance at t=T).
double BetaStart { get; set; } Gets or sets the starting beta value (noise variance at t=0).
double LearningRate { get; set; } Gets or sets the learning rate for training parameter updates.
int DefaultInferenceSteps { get; set; } Gets or sets the default number of inference steps for generation.
int TrainTimesteps { get; set; } Gets or sets the number of timesteps used during training.
int? LatentChannels { get; set; } Gets or sets the number of latent channels the model’s VAE and noise predictor operate on.