GithubHelp home page GithubHelp logo

Error in result about cppad HOT 5 CLOSED

coin-or avatar coin-or commented on June 24, 2024
Error in result

from cppad.

Comments (5)

bradbell avatar bradbell commented on June 24, 2024

Would you please simplify your example. Just output the value you get and the value you expect for the simplest case that you consider wrong. For example, if it is the Jacobian, you could output
std::cout << "CppAD Jacobian = " << jac << "\n\n"
std::cout << "Expected Jacobian = " << ?? << "\n\n";

from cppad.

drjdn avatar drjdn commented on June 24, 2024

I've simplified as much as I could above and provided better info in the output as suggested. It just computes a quadratic form and calculates its Jacobian/gradient and Hessian via CppAD. I could also remove the Hessian code if you prefer (under the assumption that the same issues is causing the problem in both cases).

Thanks,
Jason

from cppad.

bradbell avatar bradbell commented on June 24, 2024

I have reproduced and checked in a copy of your bug report; see
27158c6
When I run the script I get
True f'(x) = 7 10
CppAD f'(x) = 6 10.5

Thanks.

from cppad.

bradbell avatar bradbell commented on June 24, 2024

The matrix Q is not symmetric, hence the true derivative is more complicated than your formula; see
7823e24
Now when I run the script I get
True f'(x) = 6 10.5
CppAD f'(x) = 6 10.5

Please close this bug if you are satisfied with this result

from cppad.

drjdn avatar drjdn commented on June 24, 2024

Arrrgh! Very sorry for the noise. I work almost exclusively with symmetric positive definite Q matrices and hence my oversight.... Apologies.

Jason

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.