3 ms·
It isn't exactly common subexpressions. Basically the problem is things like matrix multiplies always get unrolled. I've used lots of operator overloading bas
by lliiffee 15y ago
It isn't exactly common subexpressions. Basically the problem is things like matrix multiplies always get unrolled.
I've used lots of operator overloading based autodiff packages for C++. They are great, but the issue is not how the function is recorded (I used operator overloading myself in my python package) but how it gets executed at runtime. Unless a compiler (or JIT) is called sometime between when the operator overloading happens and execution happens, the function is basically being interpreted at runtime. This is what happens in, e.g. ADOL-C, SACADE, and CPPAD, all of which come with a significant (e.g. 20x) performance penalty as compared with hand-written derivatives.