You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.
import minpy.numpy as np # currently need import this at the same time
from minpy.core import grad
def foo(x):
return x**2
d_foo = grad(foo)
d_2_foo = grad(d_foo)
d_3_foo = grad(d_foo)
x = np.linspace(-10, 10, 200)
# d_foo(x)
d_2_foo(x)
d_3_foo(x)
The first order gradient is right, but the second and the third order gradients are not right. My results for them are both 0.0(a single float number).
However, from the definition of foo, d_2_foo(x) should be an array of constants 2, and d_3_foo(x) should be an array of 0.
If my understanding is right, there must be some bug in the grad of grad mechanism, otherwise I would get my desired results.
The text was updated successfully, but these errors were encountered:
Following this doc pagehttps://minpy.readthedocs.io/en/latest/tutorial/autograd_tutorial.html, running the code
The first order gradient is right, but the second and the third order gradients are not right. My results for them are both
0.0
(a single float number).However, from the definition of
foo
,d_2_foo(x)
should be an array of constants 2, andd_3_foo(x)
should be an array of 0.If my understanding is right, there must be some bug in the grad of grad mechanism, otherwise I would get my desired results.
The text was updated successfully, but these errors were encountered: