Table of Contents

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

T

The numeric type.

TInput

The input data type.

TOutput

The 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

encoder IFullModel<T, TInput, TOutput>
supportInputs TInput
supportLabels TOutput
options MatchingNetworksOptions<T, TInput, TOutput>
numOps INumericOperations<T>

Properties

Metadata

Gets the model metadata.

public ModelMetadata<T> Metadata { get; }

Property Value

ModelMetadata<T>

Methods

GetModelMetadata()

Gets model metadata.

public ModelMetadata<T> GetModelMetadata()

Returns

ModelMetadata<T>

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

input TInput

Returns

TOutput

Train(TInput, TOutput)

Training is not supported for inference models.

public void Train(TInput inputs, TOutput targets)

Parameters

inputs TInput
targets TOutput

UpdateParameters(Vector<T>)

Parameter updates are not supported for inference models.

public void UpdateParameters(Vector<T> parameters)

Parameters

parameters Vector<T>