mwptoolkit.module.Embedder.basic_embedder¶
- class mwptoolkit.module.Embedder.basic_embedder.BasicEmbedder(input_size, embedding_size, dropout_ratio, padding_idx=0)[source]¶
Bases:
Module
Basic embedding layer
Initializes internal Module state, shared by both nn.Module and ScriptModule.
- forward(input_seq)[source]¶
Implement the embedding process :param input_seq: source sequence, shape [batch_size, sequence_length]. :type input_seq: torch.Tensor
- Retruns:
torch.Tensor: embedding output, shape [batch_size, sequence_length, embedding_size].
- training: bool¶