bfgsmin iterations

Przemek Klosowski przemek at jazz.ncnr.nist.gov
Wed May 13 08:40:20 CDT 2009


   I used your bfgsmin implementation and I found that it evaluates the
   objective function unnessessarily many times.
   ...
   I'd like to know it if is normal and if so, isn't there an easy way of doing a caching
   instead of double calling.

As Michael said, bfgsmin algorithm could possibly be improved, but you can easily do caching
within your own function. 


   function y=f(x)
   global f_cache;
   global f_index;
   if (index=find(f_cache.x==x)) 
      y=f_cache.y(index)
   else
      f_index=mod(++f_index,100)+1;
      f_cache.x(f_index)=x;
      y= ..... % your own calculation 
      f_cache.y(f_index)=y; 
   endif
   endfunction

I am sure there are faster and more efficient/elegant ways of doing this, please feel free 
to suggest improvements.


More information about the Help-octave mailing list