TADAMOptions<T, TInput, TOutput>
Options & Configuration · AiDotNet.MetaLearning.Options
Configuration options for Task-Dependent Adaptive Metric (TADAM) algorithm.
Inheritance: ModelOptions → TADAMOptions<T, TInput, TOutput>
Implements: IMetaLearnerOptions<T>
For Beginners
TADAM improves on Prototypical Networks by:
- Task Conditioning (TC): Adjusts features based on the specific task
- Metric Scaling: Learns how to weight different feature dimensions
- Auxiliary Co-Training: Uses additional classification to improve features
Think of it as ProtoNets that “pay attention” to what matters for each specific task.
How It Works
TADAM extends prototypical networks by incorporating task-dependent metric learning. It uses task conditioning (TC) to modulate the feature extraction process based on the task at hand, and metric scaling to adapt distances in embedding space.
Constructors
| Constructor | Summary |
|---|---|
TADAMOptions(IFullModel<T, TInput, TOutput> metaModel) |
Initializes a new instance of the TADAMOptions class with the required meta-model. |
Properties
| Property | Summary |
|---|---|
IEpisodicDataLoader<T, TInput, TOutput> DataLoader { get; set; } |
Gets or sets the episodic data loader for sampling tasks. |
IFullModel<T, TInput, TOutput> MetaModel { get; set; } |
Gets or sets the meta-model (feature encoder) to be trained. |
IGradientBasedOptimizer<T, TInput, TOutput> InnerOptimizer { get; set; } |
Must stay null: this algorithm takes no plain gradient inner step (it adapts without one, or by its own update rule), so a supplied optimizer is rejected when the learner is built. |
IGradientBasedOptimizer<T, TInput, TOutput> MetaOptimizer { get; set; } |
Optimizer for the meta-update. |
ILossFunction<T> LossFunction { get; set; } |
Loss function for meta-training; null uses cross-entropy over logits. |
bool EnableCheckpointing { get; set; } |
Gets or sets whether to save model checkpoints. |
bool NormalizeEmbeddings { get; set; } |
Gets or sets whether to normalize embeddings. |
bool UseAuxiliaryCoTraining { get; set; } |
Gets or sets whether to use auxiliary co-training. |
bool UseFirstOrder { get; set; } |
Gets or sets whether to use first-order approximation. |
bool UseMetricScaling { get; set; } |
Gets or sets whether to use metric scaling. |
bool UseTaskConditioning { get; set; } |
Gets or sets whether to use task conditioning (FiLM layers). |
double AuxiliaryLossWeight { get; set; } |
Gets or sets the weight for auxiliary loss. |
double InitialTemperature { get; set; } |
Gets or sets the initial temperature; the learned metric scale starts at alpha = 1 / InitialTemperature. |
double InnerLearningRate { get; set; } |
Gets or sets the learning rate for the inner loop (not used in TADAM). |
double L2Regularization { get; set; } |
Gets or sets the L2 penalty on the task-embedding network’s post-multiplier gamma0. |
double OuterLearningRate { get; set; } |
Gets or sets the learning rate for the outer loop (encoder training). |
double? GradientClipThreshold { get; set; } |
Gets or sets the maximum gradient norm for gradient clipping. |
int AdaptationSteps { get; set; } |
Gets or sets the number of adaptation steps. |
int CheckpointFrequency { get; set; } |
Gets or sets how often to save checkpoints. |
int EmbeddingDimension { get; set; } |
Gets or sets the embedding dimension. |
int EvaluationFrequency { get; set; } |
Gets or sets how often to evaluate the meta-learner. |
int EvaluationTasks { get; set; } |
Gets or sets the number of tasks to use for evaluation. |
int MetaBatchSize { get; set; } |
Gets or sets the number of tasks to sample per meta-training iteration. |
int NumClasses { get; set; } |
Gets or sets the number of output classes. |
int NumMetaIterations { get; set; } |
Gets or sets the total number of meta-training iterations. |
int TaskEmbeddingDimension { get; set; } |
Gets or sets the hidden width of the task-embedding network (TEN) that maps the task representation to the FiLM scale. |
int? RandomSeed { get; set; } |
Gets or sets the random seed for reproducibility. |
Methods
| Method | Summary |
|---|---|
IMetaLearnerOptions<T> Clone() |
Creates a deep copy of the TADAM options. |
bool IsValid() |
Validates that all TADAM configuration options are properly set. |