[CppAD] cppad creating a very large tape

Piers Dunstan Piers.Dunstan at csiro.au
Thu Jun 11 02:29:51 EDT 2009


Hi,
    I'm using CPPAD to obtain derivatives of a likelihood function  used 
to optimise the function.  The likelihood function is complex and has 
many operations. I have the code working properly and the derivatives 
are correct. However, when I try to use the code for large data problems 
the tape size grows very large (ie 20GB) which tends to cause problems 
on most machines.

I'm fairly certain that the problem occurs during tape creation since it 
occurs between calls to  Independent and Dependent. I'm also sure its 
not a memory leak.

Much of the data I'm using is constant and used repeatedly (ie  I have a 
double matrix with dimensions 1100 x 20 that is used 6000 times).  I 
think the problem comes from the number of operations I have to preform 
on this matrix. It is multiplied by an AD variable. I think the tape is 
making multiple copies of the elements in this matrix.

Is there a way to designate that the matrix is constant and all 
operations occur on only 1 copy (if this is the problem?)

Any ideas gratefully accepted.

Thanks  piers

-- 
/*********************************/

Dr Piers Dunstan
Marine Conservation and Biodiversity Management
CSIRO Marine and Atmospheric Research
Castray Esplanade Hobart Tasmania Australia

ph: +613 6232 5382
moblie: +614 380 860 11

/*************************************/



More information about the CppAD mailing list