bugGNU Octave - Bugs: bug #47272, Get a list of all function...

 
 

bug #47272: Get a list of all function evaluations of fminsearch

Submitted by:  Max Görner <maxg>
Submitted on:  Fri 26 Feb 2016 10:02:13 AM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  4.0.0 Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 29 Feb 2016 02:50:31 PM UTC, comment #4: 

You could try fminsearch.m from patch #8901 with the example in myproblem.m.
With very minor modifications, that is probably what you are looking for.
Please, report if you find any errors.

Markus Mützel <mmuetzel>
Project Member
Sat 27 Feb 2016 02:21:14 PM UTC, comment #3: 

OT: It sounds like the fminsearch function of the interval package could be of interest to you.

http://octave.sourceforge.net/interval/function/@infsup/fminsearch.html

It has an OutputFcn option (maybe the core  fminsearch has as well) which can be used to gain information about the tested values. Above link show an example which plots these values as sets.

Oliver Heimlich <oheim>
Sat 27 Feb 2016 09:43:31 AM UTC, comment #2: 

Unfortunately, that's not what I meant.

Firstly, one does not see where the values for each iteration were found. For example, it is not possible to answer, whether something near x = [1337, 42] was tried or not.

Secondly, thats only STDOUT. I'm thinking of a matrix that could be returned. Than one could analyse it further, eg. by visualising it via venn diagramms.

Max Görner <maxg>
Fri 26 Feb 2016 04:41:57 PM UTC, comment #1: 

Have you tried the Display option?  It might already provide what you need.

help optimset

    Display
          Request verbose display of results from optimizations.  Values
          are:

          "off" [default]
               No display.

          "iter"
               Display intermediate results for every loop iteration.

          "final"
               Display the result of the final loop iteration.

          "notify"
               Display the result of the final loop iteration if the
               function has failed to converge.

Trying on the example in the fminsearch documentation

opts = optimset ("Display", "iter");

fminsearch (@(x) (x(1)-5).^2+(x(2)-8).^4, [0;0], opts)

f(x0) = -4.1210e+03
Iter.  1,  how = initial    nf =   3,  f = -2.4706e+03  (40.0%)
Iter.  2,  how = expand,    nf =   5,  f = -1.4526e+03  (41.2%)
Iter.  3,  how = expand,    nf =   7,  f = -3.6041e+02  (75.2%)
Iter.  4,  how = expand,    nf =   9,  f = -8.2275e+00  (97.7%)
Iter.  5,  how = reflect,   nf =  11,  f = -2.4633e+00  (70.1%)
Iter.  6,  how = contract,  nf =  13,  f = -1.3366e+00  (45.7%)
Iter.  7,  how = contract,  nf =  15,  f = -8.0682e-01  (39.6%)
Iter.  8,  how = reflect,   nf =  17,  f = -5.3167e-01  (34.1%)
Iter.  9,  how = contract,  nf =  19,  f = -6.5457e-02  (87.7%)
Iter. 10,  how = contract,  nf =  21,  f = -6.5457e-02  (0.0%)
Iter. 11,  how = shrink,    nf =  25,  f = -2.4286e-02  (62.9%)
Iter. 12,  how = contract,  nf =  27,  f = -2.4286e-02  (0.0%)
Iter. 13,  how = expand,    nf =  29,  f = -1.2372e-03  (94.9%)
Iter. 14,  how = contract,  nf =  31,  f = -1.2372e-03  (0.0%)
Iter. 15,  how = contract,  nf =  33,  f = -1.2372e-03  (0.0%)
Iter. 16,  how = reflect,   nf =  34,  f = -1.2372e-03  (0.0%)
Iter. 17,  how = contract,  nf =  36,  f = -1.0750e-03  (13.1%)
Iter. 18,  how = contract,  nf =  38,  f = -7.6996e-04  (28.4%)
Iter. 19,  how = contract,  nf =  40,  f = -7.5565e-06  (99.0%)
Iter. 20,  how = reflect,   nf =  41,  f = -7.5565e-06  (0.0%)
Iter. 21,  how = contract,  nf =  43,  f = -7.5565e-06  (0.0%)
Iter. 22,  how = contract,  nf =  45,  f = -7.5565e-06  (0.0%)
Iter. 23,  how = reflect,   nf =  46,  f = -7.5565e-06  (0.0%)
Iter. 24,  how = shrink,    nf =  50,  f = -7.5565e-06  (0.0%)
Iter. 25,  how = contract,  nf =  52,  f = -5.5181e-07  (92.7%)
Iter. 26,  how = contract,  nf =  54,  f = -5.5181e-07  (0.0%)
Iter. 27,  how = reflect,   nf =  55,  f = -5.5181e-07  (0.0%)
Iter. 28,  how = contract,  nf =  57,  f = -2.5979e-07  (52.9%)
Iter. 29,  how = contract,  nf =  59,  f = -2.5979e-07  (0.0%)
Iter. 30,  how = reflect,   nf =  61,  f = -2.0956e-07  (19.3%)
Iter. 31,  how = contract,  nf =  63,  f = -1.0911e-08  (94.8%)
Iter. 32,  how = reflect,   nf =  64,  f = -1.0911e-08  (0.0%)
Iter. 33,  how = shrink,    nf =  68,  f = -1.0768e-08  (1.3%)
Iter. 34,  how = contract,  nf =  70,  f = -2.2601e-09  (79.0%)
Iter. 35,  how = reflect,   nf =  72,  f = -8.5887e-10  (62.0%)
Iter. 36,  how = contract,  nf =  74,  f = -8.5887e-10  (0.0%)
Iter. 37,  how = contract,  nf =  76,  f = -4.5694e-10  (46.8%)
Iter. 38,  how = contract,  nf =  78,  f = -1.8423e-11  (96.0%)
Iter. 39,  how = contract,  nf =  80,  f = -1.8423e-11  (0.0%)
Iter. 40,  how = shrink,    nf =  84,  f = -1.8423e-11  (0.0%)
Simplex size 8.3015e-05 <= 1.0000e-04...quitting
ans =

   5.0000
   7.9992

Rik <rik5>
Project Administrator
Fri 26 Feb 2016 10:02:13 AM UTC, original submission:  

When using fminsearch, on only gets back the position of a convergence point(*) and its value. However, these values are not sufficient to be able to judge the quality of that convergence point.

What would help greatly would be a list of all tried points and there function value. This is something fgridsearch of [patch #8918] does.

(*) One could be tempted to call it a minimum. However, it mustn't, therefore we call it convergence point.

Max Görner <maxg>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by oheim (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by maxg (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.5