Code Monkey home page Code Monkey logo

Comments (4)

jfowkes avatar jfowkes commented on August 18, 2024

Thank you for the feature request, the lack of a direct function for accessing the gradient is not very user-friendly. We are just copying the CUTEst interfaces here, but I agree this would be desirable and relatively easy to do (essentially a wrapper around problem.obj).

@lindonroberts what are your thoughts on this?

from pycutest.

lindonroberts avatar lindonroberts commented on August 18, 2024

I agree this would be useful, and perhaps a similar interface to problem.cons to just extract constraint gradients.

The only wrinkle I can see is that there is the internal CUTEst counter of objective/gradient/Hessian evaluations in problem.report() that would need adjusting. Perhaps a tally of how many times problem.grad is called, and subtract that from the total objective evaluations (since that information was ignored)?

from pycutest.

jeffrey-hokanson avatar jeffrey-hokanson commented on August 18, 2024

That's an interesting design choice in CUTEst, but I can see why it was made. Many (most? all?) optimization algorithms evaluate objective & gradient (e.g., steepest descent) or gradient & Hessian (e.g., Newton) at the same time. In the code I've been developing, I already extract the gradient as @jfowkes describes so this doesn't really bother me.

from pycutest.

jfowkes avatar jfowkes commented on August 18, 2024

I have realised there is a CUTEst_ugr function for accessing the objective gradient and a CUTEst_cigr function for accessing the constrained gradient. I will add a PyCUTEst interface to these in due course. Apologies for missing this.

from pycutest.

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.