Learning more about Dual and Primal as used in Zygote.jl

Hi all, I’ve been interested in learning more about Zygote.jl and some ways I can use it in my optimization programs. Frankly, when terminology such as dual and primal are mentioned in the context of Zygotes mechanism, I don’t really understand their function, let alone the purpose for the implementation of duals and primals in the code. Can someone perhaps give me some direction on where to look for more information on dual and primals?

1 Like

Welcome to the Julia Forum! :waving_hand:

The best starting point is probably: Duality (optimization) - Wikipedia to the generality you are looking for.

1 Like

Where are you reading about dual and primal stuff? The Zygote documentation doesn’t seem to mention “dual” anywhere: Search · Zygote.

If you search Zygote’s code for “dual”, you’ll get just a few hits, all of which seem to be related to ForwardDiff.jl, dual numbers and forward-mode automatic differentiation. One introduction to dual numbers could be Automatic Differentiation with Dual Numbers | Alejandro Morales' Blog.

According to Introduction · ChainRules, something is “primal” if it refers to the original computation f(x), not its derivatives.

2 Likes