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

Fix/sequence conv #5266

Closed
wants to merge 12 commits into from
Closed

Conversation

dzhwinter
Copy link
Contributor

fix #5263 item2

@@ -130,10 +130,10 @@ class ContextProjectFunctor {
out_t.Resize({sequence_height, context_length * sequence_width});
}
}
if (padding_trainable) {
if (col != nullptr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not appropriate, because col != nullptr always is true.

"Input(PaddingData)'s shape is not consistent with 'context_start' "
"and 'context_length'.");
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I think line 48~64 should be placed in infershape phase.

@chengduoZH
Copy link
Contributor

chengduoZH commented Nov 1, 2017

Great. PaddingTrainable is redundant.

@@ -242,10 +242,10 @@ class ContextProjectGradFunctor {
}
}
if (pad_grad) {
if (padding_trainable) {
if (padding_data) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The two judgments can be written together.
if (pad_grad && padding_data)

@@ -4,6 +4,7 @@
import unittest
import op_test
import numpy as np
exit(0)
Copy link
Member

Choose a reason for hiding this comment

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

Should be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it's a newly merged code and contains a bug. I am refactoring it.

Copy link
Member

Choose a reason for hiding this comment

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

please add an TODO here

@@ -364,12 +362,12 @@ def conv2d(input,


def sequence_pool(input, pool_type, **kwargs):
ENUM_POOL_TYPE = set(["MAX", "AVG", "SQRT", "LAST", "FIRST"])
ENUM_POOL_TYPE = set(["MAX", "SUM", "AVERAGE", "SQRT", "LAST", "FIRST"])
Copy link
Member

Choose a reason for hiding this comment

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

AVERAGE => 'AVG'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's weird implemented in sequence_pool operator. Because it has been used in chapter5 and the chapter6 in coming, so I will fix it after chapter6 and other sequence PRs merged.
Otherwise, it will make our in progress things into a mess.

Copy link
Member

@jacquesqiao jacquesqiao left a comment

Choose a reason for hiding this comment

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

LGTM!

@luotao1
Copy link
Contributor

luotao1 commented Feb 1, 2019

感谢您给PaddlePaddle贡献代码。由于Paddle V1/V2版本已不再维护,相关代码也已从develop分支上删除,因此关闭您的PR,欢迎您向Paddle最新版-Fluid贡献代码。
Thanks for contributing to PaddlePaddle! Since V1/V2 will not be maintained anymore, and related codes have been deleted from develop branch as well, we close this PR. Welcome to contribute to Fluid——the latest version of PaddlePaddle.

@luotao1 luotao1 closed this Feb 1, 2019
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.

fix sequence operator pooling/conv
4 participants