I am working on sentiment analysis of text. I am using keras word embedding. If my embedding has a vocabulary of 50 and an input length of 4 and I choose an embedding space of 8 dimensions, how will be the output from the embedding layer?

  • $\begingroup$ 50 what? What model are you talking about? What is the framework you are using? Without such minimum information it is impossible to help you. $\endgroup$ Feb 15 '19 at 6:22
  • $\begingroup$ i updated my question. $\endgroup$
    – vamsi
    Feb 15 '19 at 7:19

As noted in Keras Documentation, your embedding layer output will be of dimension:

(<batch_size>, <input_length>, <embedding dimension>)

i.e. in your case it is (None, 4, 8), where None stands for your batch size. The vocabulary size doesn't affect the output dimension, but you need to input it while constructing your Layer object.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.