espnet2.asr_transducer.joint_network.JointNetwork
Less than 1 minute
espnet2.asr_transducer.joint_network.JointNetwork
class espnet2.asr_transducer.joint_network.JointNetwork(output_size: int, encoder_size: int, decoder_size: int, joint_space_size: int = 256, joint_activation_type: str = 'tanh', lin_dec_bias: bool = True, **activation_parameters)
Bases: Module
Transducer joint network module.
- Parameters:
- output_size – Output size.
- encoder_size – Encoder output size.
- decoder_size – Decoder output size.
- joint_space_size – Joint space size.
- joint_act_type – Type of activation for joint network.
- **activation_parameters – Parameters for the activation function.
Construct a JointNetwork object.
forward(enc_out: Tensor, dec_out: Tensor, no_projection: bool = False) → Tensor
Joint computation of encoder and decoder hidden state sequences.
- Parameters:
- enc_out – Expanded encoder output state sequences. (B, T, s_range, D_enc) or (B, T, 1, D_enc)
- dec_out – Expanded decoder output state sequences. (B, T, s_range, D_dec) or (B, 1, U, D_dec)
- Returns: Joint output state sequences. : (B, T, U, D_out) or (B, T, s_range, D_out)
- Return type: joint_out