TraceApproximation.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * @file TraceApproximation.h
  3. * @author Erik Rodner
  4. * @date 01/29/2010
  5. */
  6. #ifndef _NICE_OBJREC_TRACEAPPROXIMATIONINCLUDE
  7. #define _NICE_OBJREC_TRACEAPPROXIMATIONINCLUDE
  8. #include "core/vector/MatrixT.h"
  9. #include "vislearning/math/kernels/KernelData.h"
  10. #include "core/basics/Config.h"
  11. namespace OBJREC {
  12. /** @class TraceApproximation
  13. * approximation of the trace term within the gp regression gradient
  14. *
  15. * @author Erik Rodner
  16. */
  17. class TraceApproximation
  18. {
  19. protected:
  20. int numTraceSamples;
  21. int displayPoints;
  22. public:
  23. /** simple constructor */
  24. TraceApproximation( const NICE::Config *conf, const std::string & section = "TraceApproximation" );
  25. /** simple destructor */
  26. virtual ~TraceApproximation();
  27. /** stochastic approximation of the trace term $tr(K^{-1} jacobiMatrix)$
  28. * as described in "Efficient Implementation of Gaussian Processes ..." */
  29. double getApproximateTraceTerm ( const KernelData *kernelData, const NICE::Matrix & jacobiMatrix ) const;
  30. /** stochastic approximation of the trace term $tr(K^{-1} A (x) B)$
  31. * as described in "Efficient Implementation of Gaussian Processes ..." */
  32. double getApproximateTraceTermKronecker ( const KernelData *kernelData, const NICE::Matrix & A, const NICE::Matrix & B ) const;
  33. double getApproxTraceTermKroneckerPre ( NICE::Matrix & samples, NICE::Matrix & samplesPreMultiplied, const NICE::Matrix & A, const NICE::Matrix & B ) const;
  34. void preSampling ( const KernelData *kernelData, NICE::Matrix & samples, NICE::Matrix & samplesPreMultiplied ) const;
  35. };
  36. }
  37. #endif