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

Implementing a Convolutional Rec Net #159

Open
geevi opened this issue Mar 14, 2016 · 3 comments
Open

Implementing a Convolutional Rec Net #159

geevi opened this issue Mar 14, 2016 · 3 comments

Comments

@geevi
Copy link

geevi commented Mar 14, 2016

Hi,
I was trying to implement the following:

1.) A convolutional net convert input to a vector of 500 real numbers z[1] .. z[500]
2.) A reccurent net which is given the same input z for 5 time steps and outputs a sequence of 5 labels.

First used the repeater, but it runs the conv net 5 times on the same input. I want the conv net to run once to get z, and then the recurrent net is given the same input z for 5 time steps.

Any suggestions?

thanks

@geevi geevi changed the title Implementing a Convolution Rec Net Implementing a Convolutional Rec Net Mar 14, 2016
@nicholas-leonard
Copy link
Member

Hi Girish,

Try something like :

nn.Sequential()
:add(convnet)
:add(nn.Repeater(rnn))

Regards,

Nicholas Léonard
917-741-7570

On Mon, Mar 14, 2016 at 6:14 AM, Girish Varma [email protected]
wrote:

Hi,
I was trying to implement the following:

1.) A convolutional net convert input to a vector of 500 real numbers z[1]
.. z[500]
2.) A reccurent net which is given the same input z for 5 time steps and
outputs a sequence of 5 labels.

First used the repeater, but it runs the conv net 5 times on the same
input. I want the conv net to run once to get z, and then the recurrent net
is given the same input z for 5 time steps.

Any suggestions?

thanks


Reply to this email directly or view it on GitHub
#159.

@geevi
Copy link
Author

geevi commented Mar 16, 2016

Hi Nicholas,
Wow. That was simple. I am just getting used to torch.
Thanks a lot.

Is there a way to make the rnn run on the same input, for time steps which depends on the target?
I was trying to build an ocr, where the input is an image of word and the target is a unicode string.
So the target has varying lengths. The hope was that the convnet would output a low dimensional representation of the image. Then the rnn would run for time steps equal to the length of the target string, on the same low dim. rep. (output of convnet).

I will be grateful for any suggestions.

@nicholas-leonard
Copy link
Member

@geevi The best way to do that would be to pad your targets so that they all have the same length. You could for example pad the last elements of a target with a special end-of-sequence token.

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

No branches or pull requests

2 participants