-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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_op #5130
fix_sequence_conv_op #5130
Conversation
7e9295a
to
db1bb82
Compare
paddle/operators/sequence_conv_op.cc
Outdated
@@ -128,25 +128,25 @@ class SequenceConvOpMaker : public framework::OpProtoAndCheckerMaker { | |||
"this LoDTensor is a matrix with shape (T, D), where, T is the " | |||
"total time steps in this mini-batch, D is the output feature size."); | |||
|
|||
AddAttr<bool>("padding_trainable", | |||
AddAttr<bool>("paddingTrainable", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 120 - 123, the shape for Filter
is not right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
paddle/operators/sequence_conv_op.cc
Outdated
AddAttr<int>("context_stride", | ||
"(int, default 1) the context_stride of SequenceConvOp " | ||
AddAttr<int>("contextStride", | ||
"(int, default 1) the contextStride of SequenceConvOp " | ||
"represents the step length of convolution. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
step length convolution -> stride length of convolution kernel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
paddle/operators/sequence_conv_op.cc
Outdated
AddAttr<int>("context_start", | ||
"(int, default 0) the context_start of SequenceConvOp " | ||
AddAttr<int>("contextStart", | ||
"(int, default 0) the contextStart of SequenceConvOp " | ||
"represents the beginning of the convolution of the number of " | ||
"rows of sequence, which can be negative.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More explanations:
The negative number means to pad contextStart time-steps of zeros or learnable parameters at the beginning of each instance. The positive number means to skip contextStart time-steps of each instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
paddle/operators/sequence_conv_op.cc
Outdated
AddAttr<int>("context_length", | ||
"(int, default 3) the context_length of SequenceConvOp is the " | ||
AddAttr<int>("contextLength", | ||
"(int, default 3) the contextLength of SequenceConvOp is the " | ||
"height of the convolution kernel.") | ||
.SetDefault(3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is an argument the users must set, so please do not set the default value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
From the realization of function, using StridedCopy in context_project is also appropriate. But from the efficiency analysis, the efficiency of using StridedCopy is not high. |
e5ed793
to
b08ae0b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
refine SequenceConvOp
continue #4814