I would like to use automatic differentiation to calculate gradients to function written in numpy.

I've come across a number of packages, including

But none of them seem to support things like numba and numexpr, which I'd normally use to accelerate my python code.

What packages do people use for this?

p.s. I know there's also stuff like tensorflow and pytorch, but I would like to keep my code in numpy

  • $\begingroup$ It would be useful to know the function and why you need to differentiate it automatically. $\endgroup$ Nov 1, 2021 at 12:00

1 Answer 1


Jax has the features you're looking for. See https://jax.readthedocs.io/en/latest/notebooks/quickstart.html

  • 1
    $\begingroup$ To the downvoter, why the downvote? $\endgroup$ Oct 28, 2021 at 0:14
  • 1
    $\begingroup$ Not the downvoter, but generally answers with just a link are discouraged. You should give some description of what is in the link, even if its just a quotation. This makes the answer here more useful and avoids a situation where a link eventually dies, leaving no information in the answer. $\endgroup$
    – Tyberius
    Nov 1, 2021 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.