KCGPLaplaceOneVsAll.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /**
  2. * @file KCGPLaplaceOneVsAll.h
  3. * @author Erik Rodner
  4. * @date 12/10/2009
  5. */
  6. #ifndef _NICE_OBJREC_KCGPLAPLACEONEVSALLINCLUDE
  7. #define _NICE_OBJREC_KCGPLAPLACEONEVSALLINCLUDE
  8. #include <vector>
  9. #include "vislearning/classifier/classifierbase/KernelClassifier.h"
  10. #include "vislearning/classifier/kernelclassifier/KCGPLaplace.h"
  11. #include "vislearning/classifier/kernelclassifier/LaplaceApproximation.h"
  12. #include "vislearning/regression/gpregression/modelselcrit/genericGPModelSelection.h"
  13. #include "vislearning/classifier/kernelclassifier/LikelihoodFunction.h"
  14. namespace OBJREC
  15. {
  16. #undef ROADWORKS
  17. #define ROADWORKS fthrow(NICE::Exception, "Persistent interface not implemented!");
  18. /** @class KCGPLaplaceOneVsAll
  19. * One vs. All GP Laplace classifier with joint optimization
  20. * of kernel parameters
  21. *
  22. * @author Erik Rodner
  23. */
  24. class KCGPLaplaceOneVsAll : public KernelClassifier
  25. {
  26. protected:
  27. NICE::Config confCopy;
  28. std::string confSection;
  29. bool optimizeParameters;
  30. bool verbose;
  31. int maxIterations;
  32. std::vector<LaplaceApproximation *> laplaceApproximations;
  33. LikelihoodFunction *likelihoodFunction;
  34. NICE::VVector ySetZeroMean;
  35. NICE::VectorT<int> classnos;
  36. //GPMSCLooLikelihoodRegression *modelselcrit;
  37. bool useLooParameters;
  38. public:
  39. /** simple constructor */
  40. KCGPLaplaceOneVsAll ( const NICE::Config *conf, Kernel *kernelFunction = NULL, const std::string & section = "KCGPLaplaceOneVsAll" );
  41. /** simple destructor */
  42. virtual ~KCGPLaplaceOneVsAll();
  43. /** teach the classifier with a kernel matrix and the corresponding class labels @param y ! */
  44. void teach ( KernelData *kernelData, const NICE::Vector & y );
  45. /** classify an example by using its kernel values with the training set,
  46. be careful with the order in @param kernelVector */
  47. ClassificationResult classifyKernel ( const NICE::Vector & kernelVector, double kernelSelf ) const;
  48. void restore ( std::istream&, int )
  49. {
  50. ROADWORKS
  51. };
  52. void store ( std::ostream&, int ) const
  53. {
  54. ROADWORKS
  55. };
  56. void clear()
  57. {
  58. ROADWORKS
  59. };
  60. };
  61. #undef ROADWORKS
  62. }
  63. #endif