Table of Contents

Class SSLResult<T>

Namespace
AiDotNet.SelfSupervisedLearning
Assembly
AiDotNet.dll

Result from SSL pretraining containing the trained encoder and metrics.

public class SSLResult<T>

Type Parameters

T

The numeric type used for computations.

Inheritance
SSLResult<T>
Inherited Members

Remarks

For Beginners: After SSL pretraining, this result object contains everything you need: the trained encoder, training history, and evaluation metrics. You can use the encoder for downstream tasks or continue training.

Properties

BestEpoch

Gets the epoch at which the best validation metric was achieved.

public int BestEpoch { get; set; }

Property Value

int

BestValidationMetric

Gets the best validation metric achieved during training.

public T? BestValidationMetric { get; set; }

Property Value

T

CheckpointPath

Gets or sets the path to saved checkpoint (if saved).

public string? CheckpointPath { get; set; }

Property Value

string

Config

Gets or sets the training configuration used.

public SSLConfig? Config { get; set; }

Property Value

SSLConfig

Encoder

Gets or sets the pretrained encoder network.

public INeuralNetwork<T>? Encoder { get; set; }

Property Value

INeuralNetwork<T>

Remarks

This is the main output of SSL pretraining. Use this encoder's representations for downstream tasks like classification, detection, or segmentation.

EpochsTrained

Gets or sets the number of epochs trained.

public int EpochsTrained { get; set; }

Property Value

int

ErrorMessage

Gets or sets any error message if training failed.

public string? ErrorMessage { get; set; }

Property Value

string

FinalMetrics

Gets or sets the final SSL metrics.

public SSLMetricReport<T>? FinalMetrics { get; set; }

Property Value

SSLMetricReport<T>

History

Gets or sets the training history.

public SSLTrainingHistory<T>? History { get; set; }

Property Value

SSLTrainingHistory<T>

IsSuccess

Gets or sets whether training was successful.

public bool IsSuccess { get; set; }

Property Value

bool

KNNAccuracy

Gets or sets the k-NN evaluation accuracy (if performed).

public double? KNNAccuracy { get; set; }

Property Value

double?

LinearEvaluation

Gets or sets the linear evaluation result (if performed).

public LinearEvalResult<T>? LinearEvaluation { get; set; }

Property Value

LinearEvalResult<T>

Method

Gets or sets the SSL method that was used for training.

public SSLMethodType Method { get; set; }

Property Value

SSLMethodType

TrainingTimeSeconds

Gets or sets the total training time in seconds.

public double TrainingTimeSeconds { get; set; }

Property Value

double

Methods

Failure(string)

Creates a failed SSL result.

public static SSLResult<T> Failure(string errorMessage)

Parameters

errorMessage string

Returns

SSLResult<T>

Success(INeuralNetwork<T>, SSLMethodType, SSLConfig, SSLTrainingHistory<T>)

Creates a successful SSL result.

public static SSLResult<T> Success(INeuralNetwork<T> encoder, SSLMethodType method, SSLConfig config, SSLTrainingHistory<T> history)

Parameters

encoder INeuralNetwork<T>
method SSLMethodType
config SSLConfig
history SSLTrainingHistory<T>

Returns

SSLResult<T>