|
From: | Brad Bell |
Subject: | Re: Algorithmic Differentiation in Octave |
Date: | Wed, 25 Jan 2017 06:04:34 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 |
On 01/25/2017 01:59 AM, Olaf Till wrote:
There are lots of ways to proceed here. This simplest thing to do would be to define the matrix operations in octave and have them just be element by element operators. (I assume this is possible in the Octave language). Recording the function would be slow, but once it is recorded, playback would be fast.After a look at the source, it seems to me that the interface to cppad only overloads scalar operations, not matrix multiplication and not element-wise matrix operations (like e.g. 'matrix1 ./ matrix2' in Octave). This would be a rather severe limitation for application in Octave... Olaf
Perhaps a better approach, in the long run, might be to include Cppad atomic operations in the Cppad Swig interface. It is not obvious (to me) how to do this. For example, see the atomic matrix multiply at
https://www.coin-or.org/CppAD/Doc/atomic_mat_mul.cpp.xml For a paper on matrix AD calculations; see https://people.maths.ox.ac.uk/gilesm/files/NA-08-01.pdfNote that, one only need to define the parts of the atomic operation they are using. For example, if you do not compute the sparsity patterns for Hessians, you do not need to include it. If you do not use forward mode for derivative of order higher than 3, you do not need to include them.
Brad
[Prev in Thread] | Current Thread | [Next in Thread] |