contrastive
Contrastive Trainer API
This module provides a trainer for contrastive learning.
Classes:
-
ContrastiveTrainer
–Trainer for contrastive learning
Classes
ContrastiveTrainer
ContrastiveTrainer(encoder: keras.Model, projector: keras.Model | tuple[keras.Model, keras.Model], augmenter: keras.Layer | tuple[keras.Layer, keras.Layer] | None = None, probe: keras.Layer | keras.Model | None = None)
Creates a self-supervised contrastive trainer for a model.
Parameters:
-
encoder
(Model
) –The encoder model to be trained.
-
projector
(Model | tuple[Model, Model]
) –The projector model to be trained.
-
augmenter
(Layer | tuple[Layer, Layer] | None
, default:None
) –The augmenter to be used for data augmentation.
-
probe
(Layer | Model | None
, default:None
) –The probe model to be trained. If None, no probe is used.