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

Lesson 19 - Seq2Seq - Date translator - Solutions.ipynb: Padding Doubt #8

Open
gangooteli opened this issue Nov 28, 2017 · 4 comments

Comments

@gangooteli
Copy link

Why the input is forward padded?
For e.g. 31, Aug 1986

Is there specific reason for that? What difference does it make to do padding before the input sequence instead of padding after input sequence. Please explain.

@lofar788
Copy link

lofar788 commented Dec 1, 2017

My guess would be that you want as much data as possible when your sending the encoder state into the decoder. If you padded at the end of the data the LSTM might forget the stuff at the beginning.

@sachinruk
Copy link
Owner

^correct @lofar788 . I want all the most important data closer to the final output vector. So this ought to make it easier for the network. Technically speaking it ought to be able to (learn to) ignore the paddings by itself.

@gangooteli
Copy link
Author

gangooteli commented Dec 7, 2017

@sachinruk @lofar788 We can also use seq_len and pass sequence length such that dynamic_rnn will do learning upto length of each sequence. In this we don't even need to worry about learning from pad.

@jannisborn
Copy link

@gangooteli
Interesting option, would you mind sharing your code?

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

4 participants