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

Adding increment op #4940

Merged
merged 2 commits into from
Oct 20, 2017
Merged

Conversation

abhinavarora
Copy link
Contributor

Fixes #4912

The equation is: Out = X + step
)DOC");
AddAttr<AttrType>("step", "The scaling factor of the scale operator.")
.SetDefault(1.0);
Copy link
Contributor

@qingqing01 qingqing01 Oct 20, 2017

Choose a reason for hiding this comment

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

The comments are not correct. The step is not the scaling factor. Maybe We can implement this math operation in the https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/operators/activation_op.h .

And maybe the name activation_op is not an accurate name, all these activations can be also used as the math operation.

Another option, we can modify the scale operator, let it support:

y = a * x + b

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing out the mistake in the comment. I forgot to change it. I will fix it immediately.

@qingqing01 I really like your idea of changing the scale op. However, then we might have to rename it because the word scale mean will only imply the multiplicative factor.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, you are right. One operator is benefit to save memory. But I approve this PR.

Copy link
Contributor

@qingqing01 qingqing01 left a comment

Choose a reason for hiding this comment

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

LGTM.

@abhinavarora abhinavarora merged commit 09c0c82 into PaddlePaddle:develop Oct 20, 2017
@abhinavarora abhinavarora deleted the increment_op branch October 20, 2017 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants