GBCDSolver.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /**
  2. * @file GBCDSolver.h
  3. * @author Erik Rodner
  4. * @date 01/26/2012
  5. */
  6. #ifndef _NICE_GBCDSOLVERINCLUDE
  7. #define _NICE_GBCDSOLVERINCLUDE
  8. #include "PartialGenericMatrix.h"
  9. namespace NICE {
  10. /** @class GBCDSolver
  11. * Greedy Block Coordinate Descent Algorithm
  12. *
  13. * Details are included in the paper:
  14. * "Greedy Block Coordinate Descent for Large Scale Gaussian Process Regression"
  15. * by Liefeng Bo and Cristian Sminchisescu, 2008
  16. *
  17. * Their code can be found at: http://www.cs.washington.edu/homes/lfb/software/GBCD.htm
  18. * We re-implemented their approach using the description of the algorithm in the paper.
  19. *
  20. * @author Erik Rodner
  21. */
  22. class GBCDSolver
  23. {
  24. protected:
  25. bool verbose;
  26. uint maxIterations;
  27. //! known as kappa in the paper
  28. uint randomSetSize;
  29. //! known as M in the paper
  30. uint stepComponents;
  31. double minDelta;
  32. //! detailed time analysis
  33. bool timeAnalysis;
  34. void greedyApproximation ( const PartialGenericMatrix & gm, const Vector & b, const Vector & grad,
  35. PartialGenericMatrix::SetType & B, Vector & deltaAlpha );
  36. public:
  37. /** simple constructor */
  38. GBCDSolver( uint randomSetSize = 60, uint stepComponents = 500, bool verbose = false, uint maxIterations = 10000, double minDelta = 1e-7 );
  39. /** simple destructor */
  40. virtual ~GBCDSolver();
  41. /**
  42. * @brief Solve a linear system given a PartialGenericMatrix interface
  43. *
  44. * @param gm PartialGenericMatrix interface providing sub-matrix multiplications
  45. * @param b right hand side of the system
  46. * @param x initial and final estimate
  47. *
  48. * @return method specific status information
  49. */
  50. virtual int solveLin ( const PartialGenericMatrix & gm, const Vector & b, Vector & x );
  51. /**
  52. * @brief set time analysis flag, this needs additional time and is only
  53. * important if you want to generate some time plots
  54. *
  55. * @param timeAnalysis
  56. */
  57. void setTimeAnalysis(bool timeAnalysis);
  58. };
  59. }
  60. #endif