Class MetaLearnerOptionsBuilder<T>
- Namespace
- AiDotNet.MetaLearning
- Assembly
- AiDotNet.dll
Fluent builder for MetaLearnerOptionsBase.
public class MetaLearnerOptionsBuilder<T>
Type Parameters
TThe numeric type (e.g., float, double).
- Inheritance
-
MetaLearnerOptionsBuilder<T>
- Inherited Members
Methods
Build()
Builds the options instance.
public MetaLearnerOptionsBase<T> Build()
Returns
- MetaLearnerOptionsBase<T>
The configured options.
Exceptions
- InvalidOperationException
Thrown if validation fails.
WithAdaptationSteps(int)
Sets the number of adaptation steps.
public MetaLearnerOptionsBuilder<T> WithAdaptationSteps(int steps)
Parameters
stepsint
Returns
WithCheckpointing(bool, int)
Configures checkpointing settings.
public MetaLearnerOptionsBuilder<T> WithCheckpointing(bool enabled = true, int frequency = 500)
Parameters
Returns
WithEvaluation(int, int)
Configures evaluation settings.
public MetaLearnerOptionsBuilder<T> WithEvaluation(int tasks = 100, int frequency = 100)
Parameters
Returns
WithFirstOrder(bool)
Enables first-order approximation (FOMAML).
public MetaLearnerOptionsBuilder<T> WithFirstOrder(bool useFirstOrder = true)
Parameters
useFirstOrderbool
Returns
WithGradientClipping(double?)
Sets the gradient clipping threshold.
public MetaLearnerOptionsBuilder<T> WithGradientClipping(double? threshold)
Parameters
thresholddouble?
Returns
WithInnerLearningRate(double)
Sets the inner loop learning rate.
public MetaLearnerOptionsBuilder<T> WithInnerLearningRate(double rate)
Parameters
ratedouble
Returns
WithMetaBatchSize(int)
Sets the meta-batch size.
public MetaLearnerOptionsBuilder<T> WithMetaBatchSize(int size)
Parameters
sizeint
Returns
WithNumMetaIterations(int)
Sets the number of meta-iterations.
public MetaLearnerOptionsBuilder<T> WithNumMetaIterations(int iterations)
Parameters
iterationsint
Returns
WithOuterLearningRate(double)
Sets the outer loop learning rate.
public MetaLearnerOptionsBuilder<T> WithOuterLearningRate(double rate)
Parameters
ratedouble
Returns
WithRandomSeed(int?)
Sets the random seed for reproducibility.
public MetaLearnerOptionsBuilder<T> WithRandomSeed(int? seed)
Parameters
seedint?