SHOGUN  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
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 
17 
18 namespace shogun
19 {
20 
21 template <class T> class CDenseFeatures;
22 class CHMM;
23 
41 class CFKFeatures: public CDenseFeatures<float64_t>
42 {
43  public:
45  CFKFeatures();
46 
53  CFKFeatures(int32_t size, CHMM* p, CHMM* n);
54 
56  CFKFeatures(const CFKFeatures &orig);
57 
58  virtual ~CFKFeatures();
59 
65  void set_models(CHMM* p, CHMM* n);
66 
71  inline void set_a(float64_t a)
72  {
73  weight_a=a;
74  }
75 
80  inline float64_t get_a()
81  {
82  return weight_a;
83  }
84 
89  virtual float64_t* set_feature_matrix();
90 
97 
102  inline float64_t get_weight_a() { return weight_a; };
103 
105  virtual const char* get_name() const { return "FKFeatures"; }
106 
107  protected:
116  int32_t num, int32_t& len, float64_t* target=NULL);
117 
124  void compute_feature_vector(float64_t* addr, int32_t num, int32_t& len);
125 
131  float64_t deriv_a(float64_t a, int32_t dimension=-1) ;
132 
133  private:
134  void init();
135 
136  protected:
147 };
148 }
149 #endif
float64_t set_opt_a(float64_t a=-1)
Definition: FKFeatures.cpp:91
The class DenseFeatures implements dense feature matrices.
Definition: LDA.h:24
float64_t weight_a
Definition: FKFeatures.h:146
float64_t * neg_prob
Definition: FKFeatures.h:144
float64_t get_a()
Definition: FKFeatures.h:80
float64_t deriv_a(float64_t a, int32_t dimension=-1)
Definition: FKFeatures.cpp:43
float64_t get_weight_a()
Definition: FKFeatures.h:102
virtual const char * get_name() const
Definition: FKFeatures.h:105
double float64_t
Definition: common.h:48
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:142
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:16
virtual float64_t * set_feature_matrix()
Definition: FKFeatures.cpp:214
void set_a(float64_t a)
Definition: FKFeatures.h:71
void set_models(CHMM *p, CHMM *n)
Definition: FKFeatures.cpp:128
Hidden Markov Model.
Definition: HMM.h:371
The class FKFeatures implements Fischer kernel features obtained from two Hidden Markov models...
Definition: FKFeatures.h:41

SHOGUN Machine Learning Toolbox - Documentation