Table of Contents

Class DiffusionAutoML<T>

Namespace
AiDotNet.AutoML
Assembly
AiDotNet.dll

AutoML for diffusion models with automatic hyperparameter optimization.

public class DiffusionAutoML<T> : AutoMLModelBase<T, Tensor<T>, Tensor<T>>, IAutoMLModel<T, Tensor<T>, Tensor<T>>, IFullModel<T, Tensor<T>, Tensor<T>>, IModel<Tensor<T>, Tensor<T>, ModelMetadata<T>>, IModelSerializer, ICheckpointableModel, IParameterizable<T, Tensor<T>, Tensor<T>>, IFeatureAware, IFeatureImportance<T>, ICloneable<IFullModel<T, Tensor<T>, Tensor<T>>>, IGradientComputable<T, Tensor<T>, Tensor<T>>, IJitCompilable<T>

Type Parameters

T

The numeric type used for calculations (typically float or double).

Inheritance
AutoMLModelBase<T, Tensor<T>, Tensor<T>>
DiffusionAutoML<T>
Implements
IAutoMLModel<T, Tensor<T>, Tensor<T>>
IFullModel<T, Tensor<T>, Tensor<T>>
IModel<Tensor<T>, Tensor<T>, ModelMetadata<T>>
IParameterizable<T, Tensor<T>, Tensor<T>>
ICloneable<IFullModel<T, Tensor<T>, Tensor<T>>>
IGradientComputable<T, Tensor<T>, Tensor<T>>
Inherited Members
Extension Methods

Remarks

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

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.

Constructors

DiffusionAutoML(int?)

Initializes a new instance of the DiffusionAutoML class.

public DiffusionAutoML(int? seed = null)

Parameters

seed int?

Optional random seed for reproducibility.

Properties

BestConfig

Gets the best diffusion configuration found during search.

public DiffusionTrialConfig<T>? BestConfig { get; }

Property Value

DiffusionTrialConfig<T>

NoisePredictorTypesToTry

Gets the list of noise predictor types to try during search.

public List<NoisePredictorType> NoisePredictorTypesToTry { get; }

Property Value

List<NoisePredictorType>

SchedulerTypesToTry

Gets the list of scheduler types to try during search.

public List<DiffusionSchedulerType> SchedulerTypesToTry { get; }

Property Value

List<DiffusionSchedulerType>

Methods

CreateInstanceForCopy()

Creates an instance for deep copy.

protected override AutoMLModelBase<T, Tensor<T>, Tensor<T>> CreateInstanceForCopy()

Returns

AutoMLModelBase<T, Tensor<T>, Tensor<T>>

CreateModelAsync(ModelType, Dictionary<string, object>)

Creates a diffusion model based on the specified parameters.

protected override Task<IFullModel<T, Tensor<T>, Tensor<T>>> CreateModelAsync(ModelType modelType, Dictionary<string, object> parameters)

Parameters

modelType ModelType
parameters Dictionary<string, object>

Returns

Task<IFullModel<T, Tensor<T>, Tensor<T>>>

GetDefaultSearchSpace(ModelType)

Gets the default search space for diffusion models.

protected override Dictionary<string, ParameterRange> GetDefaultSearchSpace(ModelType modelType)

Parameters

modelType ModelType

Returns

Dictionary<string, ParameterRange>

SearchAsync(Tensor<T>, Tensor<T>, Tensor<T>, Tensor<T>, TimeSpan, CancellationToken)

Searches for the best diffusion model configuration.

public override Task<IFullModel<T, Tensor<T>, Tensor<T>>> SearchAsync(Tensor<T> inputs, Tensor<T> targets, Tensor<T> validationInputs, Tensor<T> validationTargets, TimeSpan timeLimit, CancellationToken cancellationToken = default)

Parameters

inputs Tensor<T>
targets Tensor<T>
validationInputs Tensor<T>
validationTargets Tensor<T>
timeLimit TimeSpan
cancellationToken CancellationToken

Returns

Task<IFullModel<T, Tensor<T>, Tensor<T>>>

SuggestNextTrialAsync()

Suggests the next trial parameters based on search history.

public override Task<Dictionary<string, object>> SuggestNextTrialAsync()

Returns

Task<Dictionary<string, object>>