Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text classification and dynamic input / output sizes #2244

Closed
nazarblch opened this issue Apr 2, 2015 · 2 comments
Closed

text classification and dynamic input / output sizes #2244

nazarblch opened this issue Apr 2, 2015 · 2 comments
Labels

Comments

@nazarblch
Copy link

Hello,
I study methods of text classification using CNN, in this task I have input data elements with different sizes. So to process them with caffe a new type of convolution and pooling layers are required: their bottom and top blobs should have non-fixed height_ and height_out_.
Could you provide some hints or base instructions for implementing such type of layers?

@shelhamer
Copy link
Member

The convolution and pooling layers already work for this case. There's no need for new layers.

On-the-fly reshaping #594 gave layers a Reshape method so their bottom and top blobs can change shape. With reshaping data #1313 each input can be a different size. One can manually reshape in Python too like in the 3rd code cell of the filter visualization example.

All this does need documentation. Although the development you asked about is already done, you could help by adding detail to the layer documentation or making examples.

On the same topic, @pannous has nicely shared examples on speech and text that I hope to see pull requested when they're ready one day.

@shelhamer shelhamer changed the title text classification text classification and dynamic input / output sizes Apr 5, 2015
@nazarblch
Copy link
Author

Thanks for comment, I will try to help with documentation during my research.

Where I can find code blocks, corresponded for merging diffs (backward gradients) from different inputs and executing Rashape methods in data layers during train stage?

I have observed examples of nets proto for text classification (https://github.com/pannous/caffe/blob/topics/examples/topics/hello_net.prototxt), but I haven't found an intermediate layer that converts blobs from different inputs with different sizes to fixed size top blobs.
For example:
data
conv
pool
from_var_shape_to_fixed_layer
fc

from_var_shape_to_fixed_layer should be included because fc layer requires fixed bottom shape.
Has such type of layer (from_var_shape_to_fixed_layer) already implemented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants