espnet2.spk.encoder.ecapa_tdnn_encoder.EcapaTdnnEncoder
Less than 1 minute
espnet2.spk.encoder.ecapa_tdnn_encoder.EcapaTdnnEncoder
class espnet2.spk.encoder.ecapa_tdnn_encoder.EcapaTdnnEncoder(input_size: int, block: str = 'EcapaBlock', model_scale: int = 8, ndim: int = 1024, output_size: int = 1536, **kwargs)
Bases: AbsEncoder
ECAPA-TDNN encoder. Extracts frame-level ECAPA-TDNN embeddings from
mel-filterbank energy or MFCC features. Paper: B Desplanques at el.,
``
ECAPA-TDNN: Emphasized Channel Attention,
Propagation and Aggregation in TDNN Based Speaker Verification,’’ in Proc. INTERSPEECH, 2020.
- Parameters:
- input_size – input feature dimension.
- block – type of encoder block class to use.
- model_scale – scale value of the Res2Net architecture.
- ndim – dimensionality of the hidden representation.
- output_size – output embedding dimension.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(x: Tensor)
Calculate forward propagation.
- Parameters:x (torch.Tensor) – Input tensor (#batch, L, input_size).
- Returns: Output tensor (#batch, L, output_size).
- Return type: torch.Tensor
output_size() → int