The previous code for gradient has been vectorized. Now it is called gradient_fast, same mathematical definition [1] and same signature as the previous gradient and:
it is more than 100 times faster: on a Freesurfer mesh with 144k vertices it takes 0.1s (45s before)
there is new unit test in test_differential_geometry.py on a discretized sphere where the gradient of the angle theta is used because it has a nice analytic expression depending on the spherical coordinates. Of course the error between the analytic and estimated gradient depends on the resolution so the tolerance to assert the equality should be quite large (1e-2 for icosahedron sphere with 4 subdivisions = 2500 vertices).
Hello,
The previous code for gradient has been vectorized. Now it is called
gradient_fast
, same mathematical definition [1] and same signature as the previousgradient
and:test_differential_geometry.py
on a discretized sphere where the gradient of the angle theta is used because it has a nice analytic expression depending on the spherical coordinates. Of course the error between the analytic and estimated gradient depends on the resolution so the tolerance to assert the equality should be quite large (1e-2 for icosahedron sphere with 4 subdivisions = 2500 vertices).[1] see here