Menu

Convergence of optimization routines

Help
2015-05-07
2019-12-14
  • Sigurður Ægir Jónsson

    Hi,

    I have a very simple question, but for some reason I could not find an answer in the docs or in the forum (I must have missed it). When using the optimization routines, how do I check if they actually converged?

    Here is the code snipped I am using:
    double res = dlib::find_min_box_constrained(dlib::lbfgs_search_strategy(10),
    dlib::objective_delta_stop_strategy(1.0e-8,1000),
    obj_fun, dlib::derivative(obj_fun,1.0e-6), init_value, 0.0, 30.0);

     

    Last edit: Sigurður Ægir Jónsson 2015-05-07
    • Davis

      Davis - 2015-05-07

      Are you asking how you know if it terminated because of the 1e-8 condition
      vs the 1000 iteration limit?

       
      • Sigurður Ægir Jónsson

        Yes, that would be sufficient.

         
        • Davis

          Davis - 2015-05-07

          To do that you have to write your own version of the objective_delta_stop_strategy object that behaves in the way you want. If you look at the objective_delta_stop_strategy object it should be clear how to make your own.

           

          Last edit: Davis 2015-05-07
          • Sigurður Ægir Jónsson

            I will do that. Thank you very much.

             
  • 李岳容

    李岳容 - 2019-12-13

    Hi, I would like to know how to find the source code of "objective_delta_stop_strategy" in order to make my own objective_delta_stop_strategy. I can only find the guide for using it in abstract.h. I must miss something. Thank you very much for your kind answer again.

     
    • Davis

      Davis - 2019-12-14

      Use git grep to find stuff like this

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.