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
New style mean_squared_error #3194
Conversation
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.
Check comments.
def backward(self, indexes, gy): | ||
x0, x1 = self.get_retained_inputs() | ||
ret = [] | ||
diff = x0 - x1 |
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.
diff
is calculated here. You don't need to store self.diff
in forward_xxx.
@@ -1,10 +1,11 @@ | |||
import numpy | |||
|
|||
from chainer import function | |||
from chainer import function_node | |||
from chainer.functions.array import broadcast |
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.
Use chainer.functions.broadcast_to
Thank you for your review. Updated. |
jenkins test this please |
1 similar comment
jenkins test this please |
LGTM |
This PR is a part of #3147 and apply the new-style API to
mean_squared_error
.