4 ms·
Dual/Codual Numbers for Forward/Reverse Automatic Differentiation
- ogogmad 5y agoBasically, a dual number is a Real x Real while a codual number is Real x (Real -> Real). Let f(x) be dual-valued. Then its first component is the value of f(x), and the second component is its derivative f'(x). Let f(x) instead be codual-valued. Then its first component is the value of f(x), and the second component is a function of k that outputs k * f'(x). The above description of codual numbers as "Real x (Real -> Real)" is slightly wrong, but if you know about Jacobians and the chain rule for Jacobians, you should be able to fix it.
- ogogmad 5y agoI think this implementation and explanation is better: https://github.com/wlad-svennik/memoized_coduals https://github.com/wlad-svennik/memoized_coduals In a way, the codual numbers are not a different object on a purely mathematical level from the dual numbers. They are merely a different way of representing dual numbers on a computer.