FirstOrderRasmussen.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /**
  2. * @file FirstOrderRasmussen.h
  3. * @author Erik Rodner
  4. * @date 01/25/2010
  5. */
  6. #ifndef _NICE_FIRSTORDERRASMUSSENINCLUDE
  7. #define _NICE_FIRSTORDERRASMUSSENINCLUDE
  8. #include "core/optimization/gradientBased/OptimizationAlgorithmFirst.h"
  9. #include "core/optimization/gradientBased/OptimizationProblemFirst.h"
  10. namespace NICE {
  11. /** @class FirstOrderRasmussen
  12. * C/C++ implementation of Carl Edward Rasmussens matlab optimization code.
  13. * Conjugate gradient optimization (Polack-Ribiere flavour) and line
  14. * search using quadratic and cubuc approximation.
  15. * Details: http://www.kyb.tuebingen.mpg.de/bs/people/carl/code/minimize/
  16. *
  17. * \ingroup optimization_algorithms
  18. * @author Erik Rodner
  19. */
  20. class FirstOrderRasmussen : public NICE::OptimizationAlgorithmFirst
  21. {
  22. protected:
  23. /** Don't reevaluate within 0.1 of the limit of the current bracket */
  24. double c_int;
  25. /** Extrapolate maximum c_ext times the current step-size */
  26. double c_ext;
  27. /** Max c_max function evaluations per line search */
  28. uint c_max;
  29. /** Maximum allowed slope ratio */
  30. double c_ratio;
  31. /** Some constants controlling the Wolfe-Powell conditions,
  32. * details are described in the code. */
  33. double c_sig;
  34. double c_rho;
  35. /** Abort optimization if gradient norm (L2) is lower than this threshold */
  36. double epsilonG;
  37. /* If length is positive, it gives the maximum number of line searches, if negative its
  38. * absolute gives the maximum allowed number of function evaluations. */
  39. int length;
  40. /** print debug information */
  41. bool verbose;
  42. /** optimization algorithm */
  43. void doOptimizeFirst(NICE::OptimizationProblemFirst& problem);
  44. public:
  45. /** simple constructor */
  46. FirstOrderRasmussen( bool verbose = true );
  47. /** simple destructor */
  48. virtual ~FirstOrderRasmussen();
  49. /** abort optimization if gradient norm (L2) is lower than this threshold */
  50. void setEpsilonG ( double _epsilonG ) { epsilonG = _epsilonG; };
  51. /* if the parameter is positive, it gives the maximum number of line searches, if negative its
  52. * absolute gives the maximum allowed number of function evaluations. */
  53. void setMaxIterations ( int _length ) { length = _length; };
  54. };
  55. }
  56. #endif