CNN Embedding Layer for binary classification problem 1D

Viewed 177

I`m creating using python TensorFlow lib a CNN based on another work.

In this work, it uses a Embedding layer, but it does not especifies too much about the parameters used.

When I was trying to figure out the implementation, I found that there is three parameters that I should pass, and the are (font: https://machinelearningmastery.com/use-word-embedding-layers-deep-learning-keras/):

  • input_dim: This is the size of the vocabulary in the text data. For example, if your data is integer encoded to values between 0-10, then the size of the vocabulary would be 11 words.
  • output_dim: This is the size of the vector space in which words will be embedded. It defines the size of the output vectors from this layer for each word. For example, it could be 32 or 100 or even larger. Test different values for your problem.
  • input_length: This is the length of input sequences, as you would define for any input layer of a Keras model. For example, if all of your input documents are comprised of 1000 words, this would be 1000.

As you can see, I must pass the "vocabulary" of my data. In my case, it varies between 0 and 1, as it is normalized. But they are not integers, and most of the examples that I saw involving Embedding layers, you must know the possible values, or the vocabulary, so they are integers for that matter.

So my question is: does it make sense, in my data, to use a Embedding layer? And if it does, which values should I pass?

0 Answers
Related