DiffusionAutoML<T>

Models & Types ยท AiDotNet.AutoML

AutoML for diffusion models with automatic hyperparameter optimization.

Inheritance: AutoMLModelBase<T, Tensor<T>, Tensor<T>> โ†’ DiffusionAutoML<T>

For Beginners

This class automatically finds the best settings for your diffusion model.

When using diffusion models, there are many choices to make:

  • What type of neural network architecture (U-Net, DiT, etc.)
  • What sampling scheduler (DDIM, Euler, DPM-Solver, etc.)
  • How many inference steps to use
  • What guidance scale for conditional generation
  • Training hyperparameters like learning rate

DiffusionAutoML tries different combinations automatically and finds what works best for your specific data and use case.

How It Works

DiffusionAutoML automatically searches for optimal diffusion model configurations, including noise predictor architecture, scheduler type, and training hyperparameters.

Example

var trainImages = new Tensor<float>([16, 3, 32, 32]);
var trainLabels = new Tensor<float>([16, 10]);
var valImages = new Tensor<float>([4, 3, 32, 32]);
var valLabels = new Tensor<float>([4, 10]);
            
var automl = new DiffusionAutoML<float>();
var bestModel = await automl.SearchAsync(
    trainImages, trainLabels,
    valImages, valLabels,
    timeLimit: TimeSpan.FromHours(1));

Constructors

Constructor Summary
DiffusionAutoML(int? seed) Initializes a new instance of the DiffusionAutoML class.

Properties

Property Summary
DiffusionTrialConfig<T> BestConfig { get; set; } Gets the best diffusion configuration found during search.
List<DiffusionSchedulerType> SchedulerTypesToTry { get; } Gets the list of scheduler types to try during search.
List<NoisePredictorType> NoisePredictorTypesToTry { get; } Gets the list of noise predictor types to try during search.
int AutoencoderTrainingIterations { get; set; } Gets or sets the autoencoder training steps each trial runs before its denoiser trains.
int DiffusionTrainingIterations { get; set; } Gets or sets the denoiser training steps each trial runs.

Methods

Method Summary
Task<Dictionary<string, object>> SuggestNextTrialAsync() Suggests the next trial parameters based on search history.
Task<IFullModel<T, Tensor<T>, Tensor<T>>> SearchAsync(Tensor<T> inputs, Tensor<T> targets, Tensor<T> validationInputs, Tensor<T> validationTargets, TimeSpan timeLimit, CancellationToken cancellationToken) Searches for the best diffusion model configuration.