Keras parameters for convolutional network

I'm looking at Keras's example for convolutional neural networks. (For example, https://github.com/fchollet/keras/blob/master/examples/imdb_cnn.py .) However, I can't figure out what they mean by the "maxlen" parameter. Would this have anything to do with the add-on? This is not the maximum number of functions; for this they have a max_features parameter.

+3


source to share


1 answer


The parameter maxlen

is the length of your text samples in words.

In the Keras code example, you have the following settings:

# set parameters:
max_features = 5000
maxlen = 400
...
embedding_dims = 50

      

This means you have a dictionary of 5000 words, each of those words is embedded in a vector of functions with 50 sizes, and each of your text patterns can be 400 words.



Indirectly, it also has to do with padding when you have text samples that are less than 400 words in length. Then you have to superimpose them for a length of 400.

For 1D-ConvNets for text classification see also this article and this blog post:

https://arxiv.org/abs/1408.5882

http://www.wildml.com/2015/11/understanding-convolutional-neural-networks-for-nlp/

+2


source







All Articles