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

refine test_understand_sentiment_lstm #5781

Merged

Conversation

JiayiFeng
Copy link
Collaborator

fixes #5780

data = [(x[0][:chop_len], x[1]) for x in data if len(x[0]) >= chop_len]

return data[:batch_len]
return data[:batch_size]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static RNN requires all the data points within a batch have the same sequence length. In this chop_data, we make all the data to have length 80. However, some are less than 80, so we simply abandoned them.

This chop_data should only be used in the sanity check.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean that batch_size and batch_len have different means? if so, why does lstm_net use batch_size?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

batch_size and batch_len are the same thing. After looking into the revised code more, I think it does fix #5780. I am approving this.

@Canpio Please confirm that data reader is reading 100 data points per batch, and we are preprocessing each batch into 50 data points per batch and each data point is of length 80.

@JiayiFeng JiayiFeng merged commit f04c97a into PaddlePaddle:develop Nov 22, 2017
@JiayiFeng JiayiFeng deleted the fix_test_understand_sentiment_lstm branch November 22, 2017 02:05
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

Successfully merging this pull request may close these issues.

test_understand_sentiment_lstm.py only use fixed data
2 participants