KernelHIK.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * @file KernelHIK.h
  3. * @brief Interface for the (generalized) histogram intersection kernel (HIK)
  4. * @author Paul Bodesheim
  5. * @date 02/07/2013
  6. */
  7. #ifndef KERNELHIKINCLUDE
  8. #define KERNELHIKINCLUDE
  9. #include "Kernel.h"
  10. #include "ParameterizedKernel.h"
  11. namespace OBJREC {
  12. /** Interface for the popular exponential mercer kernel / rbf kernel */
  13. class KernelHIK : public ParameterizedKernel
  14. {
  15. protected:
  16. double alpha;
  17. double beta;
  18. public:
  19. /** simple constructor */
  20. KernelHIK( double alpha = 1.0, double beta = 1.0 );
  21. /** copy constructor */
  22. KernelHIK ( const KernelHIK & src );
  23. /** simple destructor */
  24. virtual ~KernelHIK();
  25. /** clone this object */
  26. KernelHIK *clone(void) const;
  27. /** compute the kernel value */
  28. double K (const NICE::Vector & x, const NICE::Vector & y) const;
  29. size_t getParameterSize () const { return 2; };
  30. void updateKernelData ( KernelData *kernelData ) const;
  31. void getKernelJacobi ( size_t parameter, const NICE::Vector & parameters, const KernelData *kernelData, NICE::Matrix & jacobiMatrix ) const;
  32. void setParameters( const NICE::Vector & newParameters );
  33. void getParameters( NICE::Vector & newParameters ) const;
  34. };
  35. } // namespace
  36. #endif