LinearEvaluator<T>

Models & Types · AiDotNet.SelfSupervisedLearning.Evaluation

Linear evaluation protocol for assessing SSL representation quality.

For Beginners

Linear evaluation is the standard way to measure how good self-supervised representations are. We freeze the pretrained encoder and train only a simple linear classifier on top. Better representations = higher accuracy.

How It Works

Why linear evaluation?

Typical protocol:

Constructors

Constructor Summary
LinearEvaluator(INeuralNetwork<T> encoder, int inputDim, int numClasses, double learningRate, int epochs) Initializes a new instance of the LinearEvaluator class.

Properties

Property Summary
int InputDimension { get; } Gets the input dimension (encoder output).
int NumClasses { get; } Gets the number of classes for classification.

Methods

Method Summary
LinearEvalResult<T> Train(Tensor<T> trainData, int[] trainLabels, Tensor<T> validData, int[] validLabels) Trains the linear classifier on the given dataset.
double Evaluate(Tensor<T> testData, int[] testLabels) Evaluates the linear classifier on a test dataset.
double EvaluateTopK(Tensor<T> testData, int[] testLabels, int k) Computes top-k accuracy.