b45ch1 / pycppad

Python Wrapper of CppAD
20 stars 9 forks source link

Sparse derivatives? #2

Closed dpo closed 12 years ago

dpo commented 12 years ago

Are there any plans to interface SparseJacobian and SparseHessian in pycppad? In optimization applications, it would be a great addition. I don't speak C++ but I can try to help. I presume it all happens in adfun.hpp and pycppad.cpp?! In what format would the sparse derivatives be returned?

Thanks.

bradbell commented 12 years ago

I am currently working on improving the sparse Jacobian and Hessian calculations in CppAD. See http://list.coin-or.org/pipermail/cppad/2012q2/000267.html Once that is done, perhaps it would be good to extend this capability to pycppad ?

A preliminary version of the new sparsity representation in terms of row and column indices can be found in

$icode%n_sweep% = f%.SparseJacobian(%x%, %p%, %r%, %c%, %jac%)%$$

from

https://projects.coin-or.org/CppAD/browser/branches/sparse/cppad/local/sparse_jacobian.hpp

It may be a while between when I finish the C++ version of the new (and more efficient) format and when I connect it to python (I have some other pressing issues to get to). Perhaps you would like to try hooking it up once the C++ is done (I would be willing to help) ?

Are there any plans to interface SparseJacobian and SparseHessian in pycppad? In optimization applications, it would be a great addition. I don't speak C++ but I can try to help. I presume it all happens in adfun.hpp and pycppad.cpp?! In what format would the sparse derivatives be returned?

Thanks.


Reply to this email directly or view it on GitHub: https://github.com/b45ch1/pycppad/issues/2

dpo commented 12 years ago

I am absolutely willing to help (to the best of my C++ knowledge).

Will it be possible to obtain sparse second derivatives of vector-valued functions c: RnRm in the vein of the current hessian() function? Aside from computing Jacobians, I mostly need the ability to form ∑ yi2 ci(x) for given x and y.

bradbell commented 12 years ago

On 05/14/2012 03:38 PM, Dominique wrote:

I am absolutely willing to help (to the best of my C++ knowledge).

Will it be possible to obtain sparse second derivatives of vector-valued functions c: RnRm in the vein of the current hessian() function? I mostly need the ability to form∑ yi2 ci(x) for given x and y.


Reply to this email directly or view it on GitHub: https://github.com/b45ch1/pycppad/issues/2#issuecomment-5704088

I have pushed the new API to the trunk, but there are some speed issues that I want to work on. This will take some time because I need to improved my speed sparsity tests first, before I work on improving the speed.

Sorry for the delay.