TIMOptions<T, TInput, TOutput>
Options & Configuration · AiDotNet.MetaLearning.Options
Configuration options for TIM (Transductive Information Maximization) (Boudiaf et al., NeurIPS 2020).
Inheritance: ModelOptions → TIMOptions<T, TInput, TOutput>
Implements: IMetaLearnerOptions<T>
For Beginners
TIM uses query examples to help classify each other:
Inductive vs Transductive:
- Inductive: Classify each query example independently
- Transductive: Use ALL query examples together (they provide info about each other)
How TIM works:
- Compute initial prototypes from support set (like ProtoNets)
- For each query, compute soft assignments to classes
- Iteratively refine assignments by maximizing mutual information:
- Conditional entropy: Each query should be confidently assigned to one class
- Marginal entropy: Classes should have balanced assignments overall
- KL divergence: Soft assignments shouldn’t deviate too far from initial predictions
Analogy: Imagine sorting a pile of photos into groups:
- Inductive: Sort each photo individually
- TIM: Sort all photos simultaneously, using the fact that groups should be balanced
and each photo should clearly belong to one group
How It Works
TIM is a transductive method that maximizes mutual information between query features and their predicted labels. By using ALL query examples jointly (not independently), it exploits the structure of the query set for better classification.
Reference: Boudiaf, M., Ziko, I., Rony, J., Dolz, J., Piantanida, P., & Ben Ayed, I. (2020). Information Maximization for Few-Shot Learning. NeurIPS 2020.
Constructors
| Constructor | Summary |
|---|---|
TIMOptions(IFullModel<T, TInput, TOutput> metaModel) |
Initializes a new instance of TIMOptions. |
Properties
| Property | Summary |
|---|---|
IEpisodicDataLoader<T, TInput, TOutput> DataLoader { get; set; } |
Gets or sets the episodic data loader. |
IFullModel<T, TInput, TOutput> MetaModel { get; set; } |
Gets or sets the feature extractor model. |
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 the default multi-class classification loss. |
bool EnableCheckpointing { get; set; } |
|
bool UseFirstOrder { get; set; } |
|
double ConditionalEntropyWeight { get; set; } |
Gets or sets the weight for the conditional entropy term. |
double InnerLearningRate { get; set; } |
|
double MarginalEntropyWeight { get; set; } |
Gets or sets the weight for the marginal entropy term. |
double OuterLearningRate { get; set; } |
|
double Temperature { get; set; } |
Gets or sets the temperature for softmax computation. |
double? GradientClipThreshold { get; set; } |
|
int AdaptationSteps { get; set; } |
Number of gradient steps taken on each task’s support set. |
int CheckpointFrequency { get; set; } |
|
int EvaluationFrequency { get; set; } |
|
int EvaluationTasks { get; set; } |
|
int MetaBatchSize { get; set; } |
|
int NumMetaIterations { get; set; } |
|
int TransductiveIterations { get; set; } |
Gets or sets the number of transductive refinement iterations. |
int? RandomSeed { get; set; } |
Gets or sets the random seed. |
Methods
| Method | Summary |
|---|---|
IMetaLearnerOptions<T> Clone() |
|
bool IsValid() |