Last active
April 13, 2020 12:00
-
-
Save alonstern/fc2a83b9bd54772b5d2e5de62b7ee559 to your computer and use it in GitHub Desktop.
embedding layer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CNNModel(nn.Module): | |
def __init__(self, embedding_dim, vocab_size): | |
super().__init__() | |
self._word_embeddings = nn.Embedding(vocab_size, embedding_dim) | |
def forward(self, sample): | |
embeds = self._word_embeddings(sample) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment