Class MatchingNetworksModel<T, TInput, TOutput>
- Namespace
- AiDotNet.MetaLearning.Algorithms
- Assembly
- AiDotNet.dll
Matching Networks model for inference.
public class MatchingNetworksModel<T, TInput, TOutput> : IModel<TInput, TOutput, ModelMetadata<T>>
Type Parameters
TThe numeric type.
TInputThe input data type.
TOutputThe output data type.
- Inheritance
-
MatchingNetworksModel<T, TInput, TOutput>
- Implements
-
IModel<TInput, TOutput, ModelMetadata<T>>
- Inherited Members
Remarks
This model encapsulates the Matching Networks inference mechanism with pre-computed support embeddings. It is returned by Adapt(IMetaLearningTask<T, TInput, TOutput>) and provides fast classification using attention over support examples.
Constructors
MatchingNetworksModel(IFullModel<T, TInput, TOutput>, TInput, TOutput, MatchingNetworksOptions<T, TInput, TOutput>, INumericOperations<T>)
Initializes a new instance of the MatchingNetworksModel.
public MatchingNetworksModel(IFullModel<T, TInput, TOutput> encoder, TInput supportInputs, TOutput supportLabels, MatchingNetworksOptions<T, TInput, TOutput> options, INumericOperations<T> numOps)
Parameters
encoderIFullModel<T, TInput, TOutput>supportInputsTInputsupportLabelsTOutputoptionsMatchingNetworksOptions<T, TInput, TOutput>numOpsINumericOperations<T>
Properties
Metadata
Gets the model metadata.
public ModelMetadata<T> Metadata { get; }
Property Value
Methods
GetModelMetadata()
Gets model metadata.
public ModelMetadata<T> GetModelMetadata()
Returns
GetParameters()
Gets encoder parameters.
public Vector<T> GetParameters()
Returns
- Vector<T>
Predict(TInput)
Makes predictions using attention over support examples.
public TOutput Predict(TInput input)
Parameters
inputTInput
Returns
- TOutput
Train(TInput, TOutput)
Training is not supported for inference models.
public void Train(TInput inputs, TOutput targets)
Parameters
inputsTInputtargetsTOutput
UpdateParameters(Vector<T>)
Parameter updates are not supported for inference models.
public void UpdateParameters(Vector<T> parameters)
Parameters
parametersVector<T>