Skip to content
heliaEDGE
Reference
HELIA

simclr

This module contains the implementation of a SimCLR trainer that can be used to train a model using the SimCLR approach.

Classes

Name Description
SimCLRTrainer A trainer for SimCLR

Machine-readable model

class

Creates a SimCLRTrainer.

helia_edge/trainers/simclr.py:17

SimCLRTrainer(encoder: keras.Model, projector: keras.Model | None = None, **kwargs={})

Creates a SimCLRTrainer.

If no projector is provided, a default one will be created based on paper.

Base class: ContrastiveTrainer.

Inherited from ContrastiveTrainer: call(), fit(), linear_probe(), run_augmenters(), save(), test_step(), train_step().

Parameters of SimCLRTrainer
NameTypeDefaultDescription
encoderkeras.ModelRequiredThe encoder model.
projectorkeras.ModelNoneThe projector model. Defaults to None.
method

compile

Python

helia_edge/trainers/simclr.py:53

compile(
encoder_optimizer: keras.Optimizer,
encoder_loss: keras.Loss | None = None,
encoder_metrics: list[keras.Metric] | None = None,
probe_optimizer: keras.Optimizer | None = None,
probe_loss: keras.Loss | None = None,
probe_metrics: list[keras.Metric] | None = None,
**kwargs={},
)