SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
FKFeatures.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 1999-2009 Soeren Sonnenburg
8  * Written (W) 1999-2008 Gunnar Raetsch
9  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
10  */
11 
12 #ifndef _CFKFEATURES__H__
13 #define _CFKFEATURES__H__
14 
15 #include <shogun/lib/config.h>
16 
19 
20 namespace shogun
21 {
22 
23 template <class T> class CDenseFeatures;
24 class CHMM;
25 
43 class CFKFeatures: public CDenseFeatures<float64_t>
44 {
45  public:
47  CFKFeatures();
48 
55  CFKFeatures(int32_t size, CHMM* p, CHMM* n);
56 
58  CFKFeatures(const CFKFeatures &orig);
59 
60  virtual ~CFKFeatures();
61 
67  void set_models(CHMM* p, CHMM* n);
68 
73  inline void set_a(float64_t a)
74  {
75  weight_a=a;
76  }
77 
82  inline float64_t get_a()
83  {
84  return weight_a;
85  }
86 
91  virtual float64_t* set_feature_matrix();
92 
99 
104  inline float64_t get_weight_a() { return weight_a; };
105 
107  virtual const char* get_name() const { return "FKFeatures"; }
108 
109  protected:
118  int32_t num, int32_t& len, float64_t* target=NULL);
119 
126  void compute_feature_vector(float64_t* addr, int32_t num, int32_t& len);
127 
133  float64_t deriv_a(float64_t a, int32_t dimension=-1) ;
134 
135  private:
136  void init();
137 
138  protected:
149 };
150 }
151 #endif
float64_t set_opt_a(float64_t a=-1)
Definition: FKFeatures.cpp:91
The class DenseFeatures implements dense feature matrices.
Definition: LDA.h:41
float64_t weight_a
Definition: FKFeatures.h:148
float64_t * neg_prob
Definition: FKFeatures.h:146
float64_t get_a()
Definition: FKFeatures.h:82
float64_t deriv_a(float64_t a, int32_t dimension=-1)
Definition: FKFeatures.cpp:43
float64_t get_weight_a()
Definition: FKFeatures.h:104
virtual const char * get_name() const
Definition: FKFeatures.h:107
double float64_t
Definition: common.h:50
virtual ~CFKFeatures()
Definition: FKFeatures.cpp:37
virtual float64_t * compute_feature_vector(int32_t num, int32_t &len, float64_t *target=NULL)
Definition: FKFeatures.cpp:148
float64_t * pos_prob
Definition: FKFeatures.h:144
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual float64_t * set_feature_matrix()
Definition: FKFeatures.cpp:214
void set_a(float64_t a)
Definition: FKFeatures.h:73
void set_models(CHMM *p, CHMM *n)
Definition: FKFeatures.cpp:128
Hidden Markov Model.
Definition: HMM.h:369
The class FKFeatures implements Fischer kernel features obtained from two Hidden Markov models...
Definition: FKFeatures.h:43

SHOGUN Machine Learning Toolbox - Documentation