selfeeg.ssl

The ssl module collects different self-supervised learning algorithms applied for the analysis of EEG Data. Each algorithm included an already implemented fit and test method, to speed up the pretraining process. In addition, this module includes an implementation of the fine-tuning function that can also be used as a standalone fit method.

It is divided in two submodules:

  • base: a submodule that include the basic objects and functions for both the pretraining and fine-tuning process.

  • contrastive: a collection of contrastive learning algorithms.

  • predictive: a collection of predictive pretraining algorithms.

  • generative: a collection of generative pretraining algorithms.

ssl.base module

Classes

EarlyStopping

Pytorch implementation of an early stopper.

SSLBase

Baseline Self-Supervised Learning nn.Module.

Functions

evaluate_loss

evaluates a custom loss function.

fine_tune

performs fine-tuning of a given model.

ssl.contrastive module

Classes

BarlowTwins

Implementation of the Barlow twins SSL method.

BYOL

Implementation of the BYOL SSL method.

MoCo

Implementation of the MoCo SSL method.

SimCLR

Implementation of the SimCLR SSL method.

SimSiam

Implementation of the SimSiam SSL method.

VICReg

Implementation of the VICReg SSL method.

ssl.generative module

Classes

ReconstructiveSSL

Implementation of a reconstructive pretraining method.

ssl.predictive module

Classes

PredictiveSSL

Implementation of a standard predictive Pretraining.