Coder Social home page Coder Social logo

Comments (4)

btracey avatar btracey commented on July 2, 2024

The direct setting you are looking for is settings.FuncEvaluations. The optimization will stop after 5 function evaluations.

The concept of "Iteration" is not synonymous with function evaluation, and is a more nebulous term. We have taken whatever the view is of the optimizer. In the quasi-Newton methods, an "Iteration" is "choose a direction and perform a linesearch" this often takes more than one function evaluation.

It sounds like you are just supplying Func and not Grad. At present, you will thus be using Nelder-Mead. It requires dim+1 function evaluations to even construct the original simplex, and sometimes an iteration of nelder mead (defined as updating the simplex size) requires dim+1 evaluations. This is how you could find such a big disparity between them.

In short, setting FuncEvaluations is likely what you want, but know that if your limit is as low as 5 you might not get very far without supplying a gradient.

from optimize.

milosgajdos avatar milosgajdos commented on July 2, 2024

Thanks for the excellent answer! The outcome did seem a bit "suspicious" to me :-)

The results I've mentioned here actually did use gradient as well. The particular optimization method I have used was optimize.BFGS{}

Thanks a lot for you explanation, it now makes more sense to me!

from optimize.

btracey avatar btracey commented on July 2, 2024

Could you test if FuncEvaluations is doing what you think it should? I'm surprised with BFGS it's taking 100 function evaluations in 5 iterations. Perhaps the problem isn't very well scaled?

from optimize.

milosgajdos avatar milosgajdos commented on July 2, 2024

Yes FuncEvaluations does seem to work as you described.

And again, yes, the problem is defo not scaled - if by scaling you mean some kind of normalization to some unit sizes. I tested this on some hand-crafted data with no normalization performed.

Thanks for your answers!

from optimize.

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.