IProjectorHead<T>

Interfaces · AiDotNet.SelfSupervisedLearning

Defines the contract for projection heads used in self-supervised learning.

Implements: IParameterSource<T>

Known implementations: LinearProjector<T>, MLPProjector<T>, SymmetricProjector<T>

For Beginners

A projection head is a small neural network that transforms encoder outputs into a space optimized for the SSL loss. After pretraining, the projection head is typically discarded and only the encoder is used for downstream tasks.

How It Works

Why use a projection head?

Common architectures:

Properties

Property Summary
int InputDimension { get; } Gets the input dimension expected by this projector.
int OutputDimension { get; } Gets the output dimension produced by this projector.
int? HiddenDimension { get; } Gets the hidden dimension (for MLP projectors).

Methods

Method Summary
IReadOnlyList<Tensor<T>> GetTrainableTensors() The head’s learnable tensors, the live objects its forward reads, in the order GetParameters flattens them.
Tensor<T> Project(Tensor<T> input) Projects encoder output to the SSL embedding space.
Vector<T> GetParameterGradients() Gets the gradients a head that keeps its own backward pass computed last.
void ClearGradients() Clears accumulated gradients.
void Reset() Resets the projector state (clears any internal buffers).
void SetTrainingMode(bool isTraining) Sets training or evaluation mode.