by PheonixPharts · 3y ago · 0 comments
Does numba do automatic differentiation?
I view JAX as primarily an automatic differentiation tool with the bonus that it makes great use of XLA and can easy make use of GPU/TPUs.
I don’t usually see numba and JAX as solving the same problem, but would be excited to be wrong
Numba compiles functions down to machine code or cuda kernels, that's it. XLA is "higher level" than what Numba produces.
You may be able to get the equivalent of jax via numba+numpy+autograd[1], but I haven't tried it before.
IMHO, jax is best thought of as a numerical computation library that happens to include autograd, vmapping, pmapping and provides a high level interface for XLA.
I have built a numerical optimisation library with it, and although a few things became verbose, it was a rather pleasant experience as the natural vmapping made everything a breeze, I didn't have to write the gradients for my testing functions, except for special cases that involved exponents and logs that needed a bit of delicate care.
I have tried it before [0]. And it works. As expected. Not much friction.
[0]: sorry no github
I had never heard of tai chi until now, I’m curious how it compares.