<p>The following suggestion is mostly related to CNNs for computer vision taks (in particular for recognition), but might also be helpful in your domain: I would have a look at <a href="http://arxiv.org/abs/1406.4729" rel="noreferrer">"Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition" by He et al.</a> proposing a Spatial Pyramid Pooling layer.</p>

<p>The general idea: The convolutional layers of a CNN (and related layers such as pooling, local response normalization etc.) are able to process variable sized input. Therefore, the problem of variable sized input propagates down to the first fully connected/inner product layer which requires a vector of fixed size. He et al. propose to add the Spatial Pyramid Pooling Layer just before the first fully-connected layer (details in the paper). The layer itself works by hierarchically partitioning the feature maps of the last convolutional layer (or the subsequent pooling or response normalization layer) into a fixed number of bins. Within these bins, responses are pooled as usually, creating a fixed-sized output (where the size depends on the hierarchy and number of bins). please see the paper for illustration.</p>

<p>The layer has been implemented based on Caffe and is available on GitHub: <a href="https://github.com/ShaoqingRen/SPP_net" rel="noreferrer">ShaoqingRen/SPP_net</a>.</p>
How to use CNN to train input data of different size?
<p>CNN seems to be implemented mostly for fixed size input. Now I want to use CNN to train some sentences of different size, what are some common methods?</p>