espnet2.asr.encoder.vgg_rnn_encoder.VGGRNNEncoder
espnet2.asr.encoder.vgg_rnn_encoder.VGGRNNEncoder
class espnet2.asr.encoder.vgg_rnn_encoder.VGGRNNEncoder(input_size: int, rnn_type: str = 'lstm', bidirectional: bool = True, use_projection: bool = True, num_layers: int = 4, hidden_size: int = 320, output_size: int = 320, dropout: float = 0.0, in_channel: int = 1)
Bases: AbsEncoder
VGGRNNEncoder class.
- Parameters:
- input_size – The number of expected features in the input
- bidirectional – If
True
becomes a bidirectional LSTM - use_projection – Use projection layer or not
- num_layers – Number of recurrent layers
- hidden_size – The number of hidden features
- output_size – The number of output features
- dropout – dropout probability
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(xs_pad: Tensor, ilens: Tensor, prev_states: Tensor | None = None) → Tuple[Tensor, Tensor, Tensor]
Defines the computation performed at every call.
Should be overridden by all subclasses.
NOTE
Although the recipe for forward pass needs to be defined within this function, one should call the Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
output_size() → int