PyramidChi2.h

Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 2008-2009 Alexander Binder
00008  * Copyright (C) 2008-2009 Fraunhofer Institute FIRST and Max-Planck-Society
00009  */
00010 
00011 #ifndef PYRAMIDCHI2_H_
00012 #define PYRAMIDCHI2_H_
00013 
00014 #include "lib/common.h"
00015 #include "kernel/SimpleKernel.h"
00016 #include "features/Features.h"
00017 #include "features/SimpleFeatures.h"
00018 
00019 namespace shogun
00020 {
00021     template <class T> class CSimpleFeatures;
00022 
00028 class CPyramidChi2 : public CSimpleKernel<float64_t>
00029 {
00030 public:
00031 
00046     CPyramidChi2(int32_t size, int32_t num_cells2,
00047         float64_t* weights_foreach_cell2, 
00048         int32_t width_computation_type2,
00049         float64_t width2);
00050 
00069     CPyramidChi2(
00070         CSimpleFeatures<float64_t>* l, CSimpleFeatures<float64_t>* r, 
00071         int32_t size, int32_t num_cells2,
00072         float64_t* weights_foreach_cell2, 
00073         int32_t width_computation_type2,
00074         float64_t width2 );
00075 
00081     virtual bool init(CFeatures* l, CFeatures* r);
00082 
00083 
00084     virtual ~CPyramidChi2();
00085 
00087     virtual void cleanup();
00088 
00090     virtual EKernelType get_kernel_type()
00091     {
00092         return K_PYRAMIDCHI2;
00093     }
00094 
00096     virtual const char* get_name() const { return "PyramidoverChi2"; }
00097 
00098 
00112     virtual void setparams_pychi2(int32_t num_cells2,
00113         float64_t* weights_foreach_cell2, 
00114         int32_t width_computation_type2,
00115         float64_t width2);
00116 
00117 protected:
00119     CPyramidChi2();
00126     virtual float64_t compute(int32_t idx_a, int32_t idx_b);
00127 
00128 protected:
00129 
00131     int32_t num_cells;
00132 
00134     float64_t* weights;
00135 
00137     int32_t width_computation_type;
00139     float64_t width;
00141     int32_t num_randfeats_forwidthcomputation;
00142 
00143 
00144 
00145 
00146 };
00147 }
00148 #endif /*PYRAMIDCHI2_H_*/
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation