espnet2.ssl.loss.abs_loss.AbsSSLLoss
Less than 1 minute
espnet2.ssl.loss.abs_loss.AbsSSLLoss
class espnet2.ssl.loss.abs_loss.AbsSSLLoss(*args, **kwargs)
Bases: Module
, ABC
Abstract loss class for encoder-only SSL model.
Each loss class must contain 2 attributes:
- self.util_attributes (List): functions that need to be : performed on encoder input (masking, noise, etc).
- self.required_inputs(List): data names needed to perform : loss calculation.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
abstract forward(encoder_output: List, encoder_output_lengths: Tensor | None = None) → Tuple[Tensor, Dict]
Forward for an SSL objective
- Parameters:
- encoder_output (List) – List of encoded sequences (B, T, D) from each layer
- encoder_output_lengths (Tensor) – Lengths of batched encoder sequences (B,),