KCGPLaplaceOneVsAll.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. #undef ROADWORKS
  16. #define ROADWORKS fthrow(Exception, "Persistent interface not implemented!");
  17. /** @class KCGPLaplaceOneVsAll
  18. * One vs. All GP Laplace classifier with joint optimization
  19. * of kernel parameters
  20. *
  21. * @author Erik Rodner
  22. */
  23. class KCGPLaplaceOneVsAll : public KernelClassifier
  24. {
  25. protected:
  26. NICE::Config confCopy;
  27. std::string confSection;
  28. bool optimizeParameters;
  29. bool verbose;
  30. int maxIterations;
  31. std::vector<LaplaceApproximation *> laplaceApproximations;
  32. LikelihoodFunction *likelihoodFunction;
  33. NICE::VVector ySetZeroMean;
  34. NICE::VectorT<int> classnos;
  35. //GPMSCLooLikelihoodRegression *modelselcrit;
  36. bool useLooParameters;
  37. public:
  38. /** simple constructor */
  39. KCGPLaplaceOneVsAll( const NICE::Config *conf, Kernel *kernelFunction = NULL, const std::string & section = "KCGPLaplaceOneVsAll" );
  40. /** simple destructor */
  41. virtual ~KCGPLaplaceOneVsAll();
  42. /** teach the classifier with a kernel matrix and the corresponding class labels @param y ! */
  43. void teach ( KernelData *kernelData, const NICE::Vector & y );
  44. /** classify an example by using its kernel values with the training set,
  45. be careful with the order in @param kernelVector */
  46. ClassificationResult classifyKernel ( const NICE::Vector & kernelVector, double kernelSelf ) const;
  47. void restore(std::istream&, int) { ROADWORKS };
  48. void store(std::ostream&, int) const { ROADWORKS };
  49. void clear() { ROADWORKS };
  50. };
  51. #undef ROADWORKS
  52. }
  53. #endif