Skip to content

Commit

Permalink
scale FD derivatives by tangent norm
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-dudt committed Jul 26, 2024
1 parent 0b2207f commit aa570d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion desc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ def func_jvp(primals, tangents):
def f(x):
return jax.flatten_util.ravel_pytree(func(*unflatx(x)))[0]

tangent_out = (f(x + fd_step * vh) - y) / fd_step
tangent_out = (f(x + fd_step * vh) - y) / fd_step * normv
tangent_out = unflaty(tangent_out)

return primal_out, tangent_out
Expand Down

0 comments on commit aa570d4

Please sign in to comment.