CNN Encoder¶
- class textbox.module.Encoder.cnn_encoder.BasicCNNEncoder(input_size, latent_size)[source]¶
Bases:
Module
Basic Convolution Neural Network (CNN) encoder. Code reference: https://github.com/rohithreddy024/VAE-Text-Generation/
- forward(input)[source]¶
Implement the encoding process.
- Parameters
input (Torch.Tensor) – source sequence embedding, shape: [batch_size, sequence_length, embedding_size].
- Returns
output features, shape: [batch_size, sequence_length, feature_size].
- Return type
torch.Tensor
- training: bool¶