check_grads fails to capture wrong gradients #17542
Unanswered
SNMS95
asked this question in
Show and tell
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was trying to implement a simple bisection algorithm. I created the algorithm and a test function and it finds the root.
However, I wanted to implement a
custom_jvp
so that there would be no unrolling and I made the following codeWhen I check the gradients like before, it shows really small number (1e-20)! But when I do check_grads, no error pops up.
check_grads(dummy_func, (design,), order=2, eps=1e-4, atol=1e-2)
Why is this the case?
Is the second implementation wrong? if so, check_grads should have caught it right?
Beta Was this translation helpful? Give feedback.
All reactions