Deep-Learning icon indicating copy to clipboard operation
Deep-Learning copied to clipboard

Why G.vocab_size+3 but not G.vocab_size

Open lmd1993 opened this issue 5 years ago • 1 comments

Hi, as far as I can see the embedding layer should be the vocab_size as input. But in cbow_model.py of Keras

shared_embedding_layer = Embedding(input_dim=(G.vocab_size+3), output_dim=G.embedding_dimension, weights=[embedding])

Where is the 3 from?

lmd1993 avatar Apr 16 '19 05:04 lmd1993

I think +1 is enough. I tried and worked. I think this is because the vocabulary is from 1 - voc + 1 label.

lmd1993 avatar Apr 16 '19 06:04 lmd1993