MatchingNetworksModel<T, TInput, TOutput>
Models & Types · AiDotNet.MetaLearning.Algorithms
Matching Networks model for inference.
Implements: IModel<TInput, TOutput, ModelMetadata<T>>
How It Works
The adapted state of Matching Networks for one task: its own copy of the embedding network, the support set’s
(context) embeddings and labels, and the learned matching function. Predict returns
P(y | x, S) per example, [rows, NumClasses], for Tensor and Matrix outputs - a class with no
support example gets probability zero, exactly as eq. 1 gives it - and the most probable class of each example
for a Vector output.
Constructors
| Constructor | Summary |
|---|---|
MatchingNetworksModel(IFullModel<T, TInput, TOutput> encoder, TInput supportInputs, TOutput supportLabels, MatchingNetworksOptions<T, TInput, TOutput> options, INumericOperations<T> numOps) |
Initializes a new instance of the MatchingNetworksModel with an untrained matching function. |
Properties
| Property | Summary |
|---|---|
ModelMetadata<T> Metadata { get; } |
Gets the model metadata. |
Methods
| Method | Summary |
|---|---|
ModelMetadata<T> GetModelMetadata() |
Gets model metadata. |
TOutput Predict(TInput input) |
Classifies by attention over the support examples. |
Vector<T> GetParameters() |
Gets the parameters of the model’s copy of the embedding network. |
void Train(TInput inputs, TOutput targets) |
Training is not supported for inference models. |
void UpdateParameters(Vector<T> parameters) |
Parameter updates are not supported for inference models. |