HyperShotOptions<T, TInput, TOutput>
Options & Configuration · AiDotNet.MetaLearning.Options
Configuration options for HyperShot (Sendera et al., NeurIPS 2023).
Inheritance: ModelOptions → HyperShotOptions<T, TInput, TOutput>
Implements: IMetaLearnerOptions<T>
For Beginners
HyperShot uses a “network that generates networks”:
- A hypernetwork takes support set features as input
- It outputs the weights for a classifier tailored to this task
- The generated classifier is used to classify query examples
This is faster than gradient-based adaptation (like MAML) because it requires only a single forward pass through the hypernetwork.
How It Works
HyperShot generates task-specific classifier weights using a hypernetwork conditioned on support set features. The hypernetwork produces a full classifier in one forward pass.
Reference: Sendera, M., Tabor, J., Nowak, A., & Trzcinski, T. (2023). HyperShot: Few-Shot Learning by Kernel HyperNetworks. NeurIPS 2023.
Constructors
| Constructor | Summary |
|---|---|
HyperShotOptions(IFullModel<T, TInput, TOutput> metaModel) |
Initializes a new instance of HyperShotOptions. |
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 InnerLearningRate { get; set; } |
|
double OuterLearningRate { get; set; } |
|
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 HypernetHiddenDim { get; set; } |
Gets or sets the hypernetwork hidden dimension. |
int MetaBatchSize { get; set; } |
|
int NumMetaIterations { get; set; } |
|
int? RandomSeed { get; set; } |
Gets or sets the random seed. |
string KernelType { get; set; } |
Gets or sets the kernel type for kernel hypernetwork. |
Methods
| Method | Summary |
|---|---|
IMetaLearnerOptions<T> Clone() |
|
bool IsValid() |