Skip to content

Gradient check use graph #5027

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

Merged
merged 25 commits into from
Oct 26, 2017
Merged

Conversation

reyoung
Copy link
Collaborator

@reyoung reyoung commented Oct 23, 2017

No description provided.

@reyoung reyoung force-pushed the gradient_check_use_graph branch 3 times, most recently from f0ca348 to 543b923 Compare October 23, 2017 23:42
@reyoung reyoung force-pushed the gradient_check_use_graph branch from ab80820 to 6a2fb0e Compare October 24, 2017 02:32
@reyoung reyoung requested review from JiayiFeng and QiJune October 24, 2017 23:39
@@ -92,4 +92,5 @@ def test_check_grad(self):


if __name__ == "__main__":
exit(0) # Gradient operator has bug!

Choose a reason for hiding this comment

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

Can we file an issue on this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -67,4 +73,5 @@ def test_check_grad(self):


if __name__ == "__main__":
exit(0) # FIXME: xe has bug

Choose a reason for hiding this comment

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

Can we file an issue on this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -112,4 +117,5 @@ def test_check_grad(self):


if __name__ == '__main__':
exit(0) # FIXME(yuyang18): This unittest is not pass. Fix it later

Choose a reason for hiding this comment

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

Can we file an issue on this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

self.__assert_is_close(numeric_grads, cpu_analytic_grads, grad_names,
max_relative_error,
self.__assert_is_close(numeric_grads, cpu_analytic_grads,
input_to_check, max_relative_error,

Choose a reason for hiding this comment

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

input_to_check => inputs_to_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.

done.


self.__assert_is_close(numeric_grads, gpu_analytic_grads,
grad_names, max_relative_error,
input_to_check, max_relative_error,

Choose a reason for hiding this comment

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

input_to_check => inputs_to_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.

done.

c_grad, g_grad, atol=1e-4),
"output name: " + name + " has diff")
@staticmethod
def _create_var_descs_(block, var_dict):
Copy link
Member

Choose a reason for hiding this comment

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

We now have two interface to create var desc for inputs and outputs, append_input_output and _create_var_descs_. It's better to unify them.

@@ -398,6 +333,7 @@ def check_grad(self,
op_attrs = self.attrs if hasattr(self, "attrs") else dict()
self.op = create_op(self.scope, self.op_type, op_inputs, op_outputs,
Copy link
Member

Choose a reason for hiding this comment

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

We are still using create_op method, and numeric_grads are calculated based on runtime. Maybe we need to add a TODO, to remove it someday.

@reyoung reyoung force-pushed the gradient_check_use_graph branch from e4f3a26 to 93da59b Compare October 26, 2017 19:50
Copy link
Member

@QiJune QiJune left a comment

Choose a reason for hiding this comment

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

LGTM

@QiJune QiJune merged commit be00b0c into PaddlePaddle:develop Oct 26, 2017
@reyoung reyoung deleted the gradient_check_use_graph branch October 28, 2017 22:12
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.

3 participants