-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling Dynamic parameters in CppADCodeGen #18
Comments
@joaoleal And also if you have some guess on how to proceed? |
I have not update CodeGen to deal with the changes in CppAD explicitly. I would say that there is no need to make changes to CppADCodegen for the new feature of CppAD. |
I need to take a better look at the implementation in cppad. |
Yes, there is a full example here: @bradbell introduces a new concept of Dynamic type as it can be seen in line |
The basic idea is that all of the sparsity patters and derivative computations are relative to the variables and do not include the dynamic parameters. You can find extensive use of dynamic parameters in the test file I am experimenting, and have seen some improvement, with the effect on speed and memory in the cppad_mixed project: It is hard for me to know what the effect would be for the CppADCodeGen project. I would suggest just implementing a small subset of operations and tests to see if it helps. |
I started adapting CppADCodeGen to support CppAD parameters but it is quite an invasive change. |
Sounds really great. |
Started a new branch: feature/parameters |
Ok thanks for reporting this adding. |
@joaoleal Do you have some news for this feature? |
I still have some issues with the support for atomic functions.
At the moment it is not possible to use parameters with adfun wrapped with
an atomic functions.
Brad has said that CppAD will have a new API that should allow this.
I was waiting for this feature.
I can also just check if there are parameters and fail for the time being.
A quarta, 24/10/2018, 09:35, Justin Carpentier <notifications@github.com>
escreveu:
… @joaoleal <https://github.com/joaoleal> Do you have some news for this
feature?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAfTYRqFMUG38uJ1uftb5pr8LZv-dxkUks5uoCZNgaJpZM4WMwpi>
.
|
It sounds great. Thanks for this quick feedback. |
Thanks for the feedback, that this is important and holding you back. I will try to get to it soon. |
I just realized that this issue is still outstanding. Does the atomic_three interface |
It suits my current needs but there is still a test failing related to custom Hessian sparsity patterns. Hopefully I will have some time during the Christmas holidays to solve it. |
Hi, Is there a way to use dynamic parameters with CppADCodeGen, or is this issue still topical ? |
I haven't completed the work on the branch yet. |
Great, thank you very much for your feedback :) |
Using the techniques in You can compute derivatives any way you like in CppAD (using dynamic parameters and such) and then, put those computations in the zero order forward mode for a CppAD function and then generate the source code for that function. |
Thank you for the example, it's really helpful to me |
One thing that may not be obvious is that in order to use base2ad with atomic functions, the atomic functions need to define the These implementations many in turn call atomic functions to do their operations; e.g., the derivatives of matrix multiply may in tern use matrix multiply; see |
By any chance, do you have an update for this feature? Thanks! |
I am working on an example that implements element-wise vector operations as atomic functions. This shows how to implement the AD derivative calculations using atomic functions; see I plan to extend this example to include all the possible atomic function calculations and all the standard math functions. @joaoleal I am not sure how one would use such atomic functions in CppADCodeGen (once the base type is a template parameter) ? |
Current master branch of CppAD allows the use of dynamic parameters.
In other words, it is possible to change at running time some parameters values that are not consider as Independent variables.
See https://github.com/coin-or/CppAD/blob/46be2e2dbcaba47d8a38e8d9110efc48c7245754/cppad/core/new_dynamic.hpp#L103 for further details.
I want to know how to implement this feature in CppADCOdeGen.
@joaoleal can you explain me where I need to edit this new feature?
The text was updated successfully, but these errors were encountered: