espnet2.spk.encoder.e_branchformer_encoder.EBranchformerSpkEncoder
Less than 1 minute
espnet2.spk.encoder.e_branchformer_encoder.EBranchformerSpkEncoder
class espnet2.spk.encoder.e_branchformer_encoder.EBranchformerSpkEncoder(input_size: int, aggregate_layer: bool = True, **kwargs)
Bases: EBranchformerEncoder
E-Branchformer encoder that outputs frame-level speaker features.
The blocks are those of the ASR E-Branchformer (Kim et al., SLT 2022). With aggregate_layer, the outputs of every block are concatenated along the feature axis before the final layer norm, as MFA-Conformer does (Zhang et al., Interspeech 2022), so the output size is output_size * num_blocks.
- Parameters:
- input_size (int) – Input feature dimension.
- aggregate_layer (bool) – Concatenate the outputs of all blocks instead of returning only the last one.
- **kwargs – Passed to
EBranchformerEncoder.interctc_layer_idxis not supported here.
Initialize internal Module state, shared by both nn.Module and ScriptModule.
forward(x: Tensor) → Tensor
Calculate forward propagation.
- Parameters:x (torch.Tensor) – Input features (#batch, time, input_size).
- Returns: Frame-level features (#batch, output_size, time’).
- Return type: torch.Tensor
