Automatic Differentiation

The automatic differentiation packages in Julia are quite sophisticated. They implement most of the standard chain rules in these documents by manipulating the syntax of the Julia function.

This means you should keep your Julia function syntax as clean and simple as possible.

The package you want is Zygote and the functions are: gradient, jacobian, hessian

ChatGPT wrote the following code for me in response to a prompt about using Julia to do an automatic gradient.