horde-ad
horde-ad copied to clipboard
Define dual number counterparts of most orthotope operations
In some cases, the task will involve generalizing an operation already defined on tensors or on matrices or vectors. In many cases the task will require introducing new delta expression constructors (or generalizing old ones).
Most of the operations from
https://hackage.haskell.org/package/orthotope-0.1.2.0/docs/Data-Array-ShapedS.html
that have tensor codomains are sensible candidates. For some of them, full generality may be hard to sustain or perhaps even impossible (I'm not sure why it would be so, e.g., is it possible that a differentiable function on matrices becomes non-differentiable when generalized to higher dimensions?). In that case, less general versions may be useful enough and may turn out to be much easier to optimize, as well.
It makes sense to first define the operations and only in later stages worry about performance, because optimization may require defining sparse representations of the scaling factor (#18) and may be harder for the general case than, e.g., for a rank 2 variant that can use the hmatrix/lapack/blas library under the hood instead of fine-tuning its own C code or biding to new C libraries.