SelfSupervisedLearningMethodBase<T>

Base Classes ยท AiDotNet.SelfSupervisedLearning

Abstract base class for self-supervised learning methods. Extends ModelBase for unified model framework participation.

Inheritance: ModelBase<T, Tensor<T>, Tensor<T>> โ†’ SelfSupervisedLearningMethodBase<T>

Implements: IGeneratedParameterRegistrar<T>, ISelfSupervisedLearningMethod<T>

Known derived types: BYOL<T>, BarlowTwins<T>, MAE<T>, MoCoV3<T>, MoCo<T>, SimCLR<T>, SimSiam<T>, TeacherStudentSSL<T>

For Beginners

This base class provides common functionality shared by all SSL methods, including parameter management, training mode control, and configuration handling.

How It Works

Derived classes (SimCLR, MoCo, BYOL, etc.) implement the specific training logic in the TrainStepCore method.

Properties

Property Summary
ILossFunction<T> DefaultLossFunction { get; }
SelfSupervisedLearningMethodCategory Category { get; }
bool RequiresMemoryBank { get; }
bool UsesMomentumEncoder { get; }
string Name { get; }

Methods

Method Summary
IFullModel<T, Tensor<T>, Tensor<T>> DeepCopy()
IFullModel<T, Tensor<T>, Tensor<T>> WithParameters(Vector<T> parameters)
INeuralNetwork<T> GetEncoder()
SelfSupervisedLearningStepResult<T> TrainStep(Tensor<T> batch, SelfSupervisedLearningAugmentationContext<T> augmentationContext)
Tensor<T> Encode(Tensor<T> input)
Tensor<T> Predict(Tensor<T> input)
double GetEffectiveLearningRate() Gets the effective learning rate based on configuration and scheduling.
void OnEpochEnd(int epochNumber) Signals the end of an epoch.
void OnEpochStart(int epochNumber) Signals the start of a new epoch.
void Reset()
void SetTrainingMode(bool isTraining) Sets the training mode for the SSL method.
void Train(Tensor<T> input, Tensor<T> expectedOutput) Trains the SSL method.