LinearProjector<T>

Models & Types · AiDotNet.SelfSupervisedLearning

Linear projection head for self-supervised learning.

Implements: IParameterChunkSource<T>, IParameterLayoutSource, IProjectorHead<T>

For Beginners

A linear projector is the simplest projection head - just a single linear transformation (matrix multiplication + bias). While simpler than MLP projectors, linear projectors can still be effective in some scenarios.

How It Works

Architecture:

When to use Linear vs MLP:

Constructors

Constructor Summary
LinearProjector(int inputDim, int outputDim, bool useBias, int? seed) Initializes a new instance of the LinearProjector class.

Properties

Property Summary
int InputDimension { get; }
int OutputDimension { get; }
int? HiddenDimension { get; }
long ParameterCount { get; }

Methods

Method Summary
IReadOnlyList<Tensor<T>> GetTrainableTensors()
Tensor<T> Project(Tensor<T> input)
Vector<T> GetParameterGradients()
Vector<T> GetParameters()
void ClearGradients()
void Reset()
void SetParameters(Vector<T> parameters)
void SetTrainingMode(bool isTraining)