espnet2.asr_transducer.encoder.building.build_main_parameters
Less than 1 minute
espnet2.asr_transducer.encoder.building.build_main_parameters
espnet2.asr_transducer.encoder.building.build_main_parameters(pos_wise_act_type: str = 'swish', conv_mod_act_type: str = 'swish', pos_enc_dropout_rate: float = 0.0, pos_enc_max_len: int = 5000, simplified_att_score: bool = False, norm_type: str = 'layer_norm', conv_mod_norm_type: str = 'layer_norm', after_norm_eps: float | None = None, after_norm_partial: float | None = None, blockdrop_rate: float = 0.0, dynamic_chunk_training: bool = False, short_chunk_threshold: float = 0.75, short_chunk_size: int = 25, num_left_chunks: int = 0, **activation_parameters) → Dict[str, Any]
Build encoder main parameters.
- Parameters:
- pos_wise_act_type – X-former position-wise feed-forward activation type.
- conv_mod_act_type – X-former convolution module activation type.
- pos_enc_dropout_rate – Positional encoding dropout rate.
- pos_enc_max_len – Positional encoding maximum length.
- simplified_att_score – Whether to use simplified attention score computation.
- norm_type – X-former normalization module type.
- conv_mod_norm_type – Conformer convolution module normalization type.
- after_norm_eps – Epsilon value for the final normalization.
- after_norm_partial – Value for the final normalization with RMSNorm.
- blockdrop_rate – Probability threshold of dropping out each encoder block.
- dynamic_chunk_training – Whether to use dynamic chunk training.
- short_chunk_threshold – Threshold for dynamic chunk selection.
- short_chunk_size – Minimum number of frames during dynamic chunk training.
- num_left_chunks – Number of left chunks the attention module can see. (null or negative value means full context)
- **activation_parameters – Parameters of the activation functions. (See espnet2/asr_transducer/activation.py)
- Returns: Main encoder parameters