[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Algorithmic Differentiation in Octave
From: |
Olaf Till |
Subject: |
Re: Algorithmic Differentiation in Octave |
Date: |
Fri, 27 Jan 2017 21:20:56 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, Jan 27, 2017 at 09:05:35AM -0700, Brad Bell wrote:
> Given that Octave, like python with numpy, has a way to create matrix
> operations from scalar ones, I do not think the recording will be slow.
I do not understand, could you explain? What do you mean by creating
matrix operations from scalar ones? What is the relation to the speed
of recording? (I know what Octave can do, but I don't know what you
mean.)
> >In any case, whether the splitting into element operations takes place
> >in Octave or in the swig interface, the result, after recording and
> >running, must be translated back into Jakobians and Hessians in the
> >matrix- or array-representatin of Octave. This is an additional
> >problem, which AFAICS can't be reasonably solved. So maybe it would be
> >more reasonable to support matrix operations directly in the cppad
> >library?
> I do not see any problem here. The Jacobians and Hessians are returned as
> simple vectors and special purpose *.m files could put them in any desired
> form.
Still can't see it... Say we have matrices A:=[a11, a12; a21, a22] and
B:=[b11, b12; b21, b22], both A and B somehow depending on a vector of
a_double. If we overload matrix multiplication (normally done symply
by typing A*B in Octave), to make it recordable, into scalar
operations, we compute C:=A*B as c11=a11*b11+a12*b21,
c12=a11*b12+a12*b22, c21=..., c22=... . We have to return the zero
order result, so we concatenate c11, ..., c22 into a Matrix C
e.g. with the Octave command C=[c11, c12; c21, c22], and let the
overloaded method return C. Since all computed c.. should be of type
a_vector, the operation should have been recorded by cppad. But if we
run the record to get the derivatives, in which form will they be
returned? cppad has only records for the four single values c11, ...,
c22, it doesn't know that they belong together ... or what?
If you correct the above, please be detailed, so that I can understand
it although I'm not familiar with cppad.
Olaf
--
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net
signature.asc
Description: Digital signature
- Re: Algorithmic Differentiation in Octave, (continued)
- Re: Algorithmic Differentiation in Octave, Brad Bell, 2017/01/26
- Re: Algorithmic Differentiation in Octave, Olaf Till, 2017/01/25
- Re: Algorithmic Differentiation in Octave, Brad Bell, 2017/01/25
- AD matrix operations, Brad Bell, 2017/01/26
- Re: AD matrix operations, John W. Eaton, 2017/01/26
- Re: AD matrix operations, Brad Bell, 2017/01/26
- Re: AD matrix operations, John W. Eaton, 2017/01/26
- Re: Algorithmic Differentiation in Octave, Brad Bell, 2017/01/27
- Re: Algorithmic Differentiation in Octave, Olaf Till, 2017/01/27
- Re: Algorithmic Differentiation in Octave, Brad Bell, 2017/01/27
- Re: Algorithmic Differentiation in Octave,
Olaf Till <=
- Re: Algorithmic Differentiation in Octave, Brad Bell, 2017/01/27
- Re: Algorithmic Differentiation in Octave, Olaf Till, 2017/01/28