MetaOptNetModel<T, TInput, TOutput>
Models & Types · AiDotNet.MetaLearning.Models
The linear classifier MetaOptNet’s convex base learner produced for one task.
Implements: IModel<TInput, TOutput, ModelMetadata<T>>
How It Works
Holds its own copy of the embedding network and one weight row per class. Predict returns each
example’s score for every class, [rows, NumClasses], scaled by the learned logit scale of eq. 12, for
Tensor and Matrix outputs, and the highest-scoring class for a Vector output. It used to flatten the batch into
one vector, so a batch of four examples produced one score per class instead of four.
Constructors
| Constructor | Summary |
|---|---|
MetaOptNetModel(IFullModel<T, TInput, TOutput> featureEncoder, Matrix<T> classifierWeights, T temperature, MetaOptNetOptions<T, TInput, TOutput> options) |
Initializes a new instance of the MetaOptNetModel. |
Properties
| Property | Summary |
|---|---|
Matrix<T> ClassifierWeights { get; } |
Gets the classifier the base learner produced, one row per class. |
ModelMetadata<T> Metadata { get; } |
|
T Temperature { get; } |
Gets the scale that multiplies the logits. |
int NumClasses { get; } |
Gets the number of classes. |
Methods
| Method | Summary |
|---|---|
ModelMetadata<T> GetModelMetadata() |
|
TOutput Predict(TInput input) |
|
Vector<T> GetParameters() |
|
void Train(TInput inputs, TOutput targets) |
|
void UpdateParameters(Vector<T> parameters) |