TransferBenchmark<T>
Models & Types · AiDotNet.SelfSupervisedLearning.Evaluation
Transfer learning benchmark for evaluating SSL representations on downstream tasks.
For Beginners
Transfer learning benchmarks test how well pretrained representations transfer to new tasks. We take an encoder pretrained on one dataset (e.g., ImageNet) and evaluate it on different tasks (e.g., object detection, segmentation).
How It Works
Common transfer benchmarks:
Evaluation protocols:
Constructors
| Constructor | Summary |
|---|---|
TransferBenchmark(INeuralNetwork<T> encoder, int encoderOutputDim) |
Initializes a new instance of the TransferBenchmark class. |
Methods
| Method | Summary |
|---|---|
BenchmarkResult<T> KNNEvaluation(Tensor<T> trainData, int[] trainLabels, Tensor<T> testData, int[] testLabels, int k) |
Runs k-NN evaluation on a downstream dataset. |
BenchmarkResult<T> LinearProbing(Tensor<T> trainData, int[] trainLabels, Tensor<T> testData, int[] testLabels, int numClasses, int epochs) |
Runs linear probing evaluation on a downstream dataset. |
BenchmarkSuite<T> RunFullSuite(Tensor<T> trainData, int[] trainLabels, Tensor<T> testData, int[] testLabels, int numClasses, string datasetName) |
Runs a full benchmark suite. |
Dictionary<double, BenchmarkResult<T>> FewShotEvaluation(Tensor<T> trainData, int[] trainLabels, Tensor<T> testData, int[] testLabels, int numClasses, double[] percentages) |
Runs few-shot evaluation with limited labeled data. |