1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #ifndef _NICE_OBJREC_LAPLACEAPPROXIMATIONINCLUDE
- #define _NICE_OBJREC_LAPLACEAPPROXIMATIONINCLUDE
- #include "core/basics/Config.h"
- #include "vislearning/classifier/kernelclassifier/LikelihoodFunction.h"
- #include "vislearning/math/kernels/KernelData.h"
- namespace OBJREC {
-
- class LaplaceApproximation
- {
- protected:
-
- uint maxiterations;
- double minimumDelta;
- bool verbose;
-
- NICE::Vector mode;
- NICE::Vector hessianW;
- NICE::Vector gradientL;
- NICE::Matrix cholB;
- NICE::Vector a;
- double objective;
- double noiseTerm;
- void updateCache ( const NICE::Matrix & kernelMatrix, const NICE::Vector & y, const LikelihoodFunction *likelihoodFunction );
- public:
-
-
- LaplaceApproximation();
-
- LaplaceApproximation( const NICE::Config *conf, const std::string & section = "LaplaceApproximation" );
-
-
- virtual ~LaplaceApproximation();
-
- void approximate ( KernelData *kernelData, const NICE::Vector & y,
- const LikelihoodFunction *likelihoodFunction );
- double predict ( const NICE::Vector & kernelVector, double kernelSelf, const NICE::Vector & y,
- const LikelihoodFunction *likelihoodFunction ) const;
- const NICE::Vector & getMode () const { return mode; };
- const NICE::Vector & getHessian () const { return hessianW; };
- const NICE::Vector & getGradient () const { return gradientL; };
- const NICE::Vector & getAVector () const { return a; };
- const NICE::Matrix & getCholeskyB () const { return cholB; };
- double getObjective () const { return objective; };
- };
- }
- #endif
|