1
$\begingroup$

According to the example given on this blogpost on wildml (see image below), it seems like it makes no difference what size the input because the size of the max-pooling layer is constant.

enter image description here

However, I swear I've heard people talk about various methods of normalizing input images by rescaling and cropping so that they are the same size. Would that be purely for the purpose of mini-batching? Or, is the pooling layer above a special case which allows uneven input sizes?

$\endgroup$
1
$\begingroup$

Indeed, CNNs typically use same-size input.

If you take a closer at step 3 in that blog posting:

  1. Pad each sentence to the maximum sentence length, which turns out to be 59. We append special tokens to all other sentences to make them 59 words. Padding sentences to the same length is useful because it allows us to efficiently batch our data since each example in a batch must be of the same length.

You will see they are using fixed size input there as well.

For text processing in general, it is common to preprocess your data with word-embeddings. Methods such as tf-idf, word2vec and doc2vec take your words/text and provide fixed size numerical input.

$\endgroup$
  • $\begingroup$ You only need to use inputs of the same size if you want to batch them together during training, otherwise you could have variable input size I believe. $\endgroup$ – Miguel Sep 21 '17 at 8:20

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.