mmlearn.tasks.contrastive_pretraining.AuxiliaryTaskSpec

class AuxiliaryTaskSpec(modality, task, loss_weight=1.0)[source]

Bases: object

Specification for an auxiliary task to run alongside the main task.

Methods

Attributes

loss_weight: float = 1.0

The weight to apply to the auxiliary task loss.

modality: str

The modality of the encoder to use for the auxiliary task.

task: Any

The auxiliary task module. This is expected to be a partially-initialized instance of a LightningModule created using functools.partial(), such that an initialized encoder can be passed as the only argument.