Class DiffusionAutoML<T>
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
TThe numeric type used for calculations (typically float or double).
- Inheritance
-
DiffusionAutoML<T>
- Implements
- Inherited Members
-
AutoMLModelBase<T, Tensor<T>, Tensor<T>>.SetModelEvaluator(IModelEvaluator<T, Tensor<T>, Tensor<T>>)
- 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
seedint?Optional random seed for reproducibility.
Properties
BestConfig
Gets the best diffusion configuration found during search.
public DiffusionTrialConfig<T>? BestConfig { get; }
Property Value
NoisePredictorTypesToTry
Gets the list of noise predictor types to try during search.
public List<NoisePredictorType> NoisePredictorTypesToTry { get; }
Property Value
SchedulerTypesToTry
Gets the list of scheduler types to try during search.
public List<DiffusionSchedulerType> SchedulerTypesToTry { get; }
Property Value
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
modelTypeModelTypeparametersDictionary<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
modelTypeModelType
Returns
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
inputsTensor<T>targetsTensor<T>validationInputsTensor<T>validationTargetsTensor<T>timeLimitTimeSpancancellationTokenCancellationToken
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()