GithubHelp home page GithubHelp logo

Comments (10)

bradbell avatar bradbell commented on July 3, 2024 1

As I mentioned, but perhaps was not clear about, all the derivatives of the Value(Var2Par(y)) are zero, even it the derivatives of y are not zero. It you need to track the dependency (derivatives) you need to use an AD type. So the real question is why are you using double and not AD<double> ?

from cppad.

bradbell avatar bradbell commented on July 3, 2024 1

If the source for the transformation is not to large, convert it to a function where double is replaced by a template parameter so that you can use the source code with both double and AD<double>.

Also, it sounds like (but I am not sure) you are interpolating values, so you may want to look at
https://coin-or.github.io/CppAD/doc/interp_onetape.cpp.htm
https://coin-or.github.io/CppAD/doc/interp_retape.cpp.htm

from cppad.

vimalrajayyappan avatar vimalrajayyappan commented on July 3, 2024

I found the way. There is a function in CppAd::Value(AD<>) will give the value.

Is that right?

from cppad.

vimalrajayyappan avatar vimalrajayyappan commented on July 3, 2024

While I was getting my code Compiled. Its showing error while Runtime. Kindly help me with this. The error is

cppad-20160000.1 error from a known source:
Value: argument is a variable (not a parameter)
Error detected by false result for
Parameter(x)

from cppad.

bradbell avatar bradbell commented on July 3, 2024

You can only extract the value for a parameter (a parameter does not depend on the independent variables). This is because the value of an AD object has type Base which does not track dependency on AD independent variables. If you really want the value with out the dependency, use Var2Par;
https://coin-or.github.io/CppAD/doc/var2par.htm

from cppad.

vimalrajayyappan avatar vimalrajayyappan commented on July 3, 2024

Dear BradBel. Exactly solved the issue..nice

But I got stuck with one more issue. When I'm converting the variable using Var2Par in cost functions, the optimiser is not recognising the cost.. Its not even considering the cost even though the values are high and appropriate . Can you help?

I know this explanation makes no meaning. But I figured it out in that way.

from cppad.

bradbell avatar bradbell commented on July 3, 2024

Why are you using the Value function ?

from cppad.

vimalrajayyappan avatar vimalrajayyappan commented on July 3, 2024

Actually there are certain implementations where I'm using "double" datatype. Which is causing a typecasting issue. Hence I'm using CppAD::Value to get it to its base type and feed them.

from cppad.

vimalrajayyappan avatar vimalrajayyappan commented on July 3, 2024

One good example I can give you.

The points getting optimised are in global frame. I'm having a common.hpp file where there is a transformation function using double. I need to use that function to transform points in local frame. Hence typecasting..

But from your answer I get to know we must use Ad. to track. Is tat ryt?

from cppad.

vimalrajayyappan avatar vimalrajayyappan commented on July 3, 2024

Dear BradBel. Thanks a lot for your kind help. I will dig into the links u have shared. 😊

from cppad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.