Reputation: 211
What is the correct dimension size for nn embeddings in Pytorch? I'm doing batch training.
I'm just a little confused with what the dimensions of "self.embeddings" in the code below are supposed to be when I get "shape"?
self.embeddings = nn.Embedding(vocab_size, embedding_dim)
Upvotes: 0
Views: 2527
Reputation: 5102
The shape of the self.embedding
will be [sentence_length, batch_size, embedding_dim]
where sentence_length
is the length of inputs in each batch.
Upvotes: 1