SHOGUN  3.2.1
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
TOPFeatures.h
浏览该文件的文档.
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 _CTOPFEATURES__H__
13 #define _CTOPFEATURES__H__
14 
17 
18 namespace shogun
19 {
20 template <class T> class CDenseFeatures;
21 class CHMM;
22 
23 #ifndef DOXYGEN_SHOULD_SKIP_THIS
24 
25 struct T_HMM_INDIZES
26 {
28  int32_t* idx_p;
30  int32_t* idx_q;
32  int32_t* idx_a_rows;
34  int32_t* idx_a_cols;
36  int32_t* idx_b_rows;
38  int32_t* idx_b_cols;
39 
41  int32_t num_p;
43  int32_t num_q;
45  int32_t num_a;
47  int32_t num_b;
48 };
49 #endif // DOXYGEN_SHOULD_SKIP_THIS
50 
68 class CTOPFeatures : public CDenseFeatures<float64_t>
69 {
70  public:
72  CTOPFeatures();
73 
82  CTOPFeatures(int32_t size, CHMM* p, CHMM* n, bool neglin, bool poslin);
83 
85  CTOPFeatures(const CTOPFeatures &orig);
86 
87  virtual ~CTOPFeatures();
88 
94  void set_models(CHMM* p, CHMM* n);
95 
100  virtual float64_t* set_feature_matrix();
101 
106  int32_t compute_num_features();
107 
114  bool compute_relevant_indizes(CHMM* hmm, T_HMM_INDIZES* hmm_idx);
115 
117  virtual const char* get_name() const { return "TOPFeatures"; }
118 
119  protected:
128  int32_t num, int32_t& len, float64_t* target=NULL);
129 
136  void compute_feature_vector(float64_t* addr, int32_t num, int32_t& len);
137 
138  private:
139  void init();
140 
141  protected:
147  bool neglinear;
149  bool poslinear;
150 
152  T_HMM_INDIZES pos_relevant_indizes;
154  T_HMM_INDIZES neg_relevant_indizes;
155 };
156 }
157 #endif
T_HMM_INDIZES pos_relevant_indizes
Definition: TOPFeatures.h:152
virtual float64_t * set_feature_matrix()
void set_models(CHMM *p, CHMM *n)
Definition: TOPFeatures.cpp:64
T_HMM_INDIZES neg_relevant_indizes
Definition: TOPFeatures.h:154
virtual const char * get_name() const
Definition: TOPFeatures.h:117
virtual float64_t * compute_feature_vector(int32_t num, int32_t &len, float64_t *target=NULL)
Definition: TOPFeatures.cpp:86
double float64_t
Definition: common.h:48
The class TOPFeatures implements TOP kernel features obtained from two Hidden Markov models...
Definition: TOPFeatures.h:68
The class DenseFeatures implements dense feature matrices.
Definition: LDA.h:24
bool compute_relevant_indizes(CHMM *hmm, T_HMM_INDIZES *hmm_idx)
int32_t compute_num_features()
Hidden Markov Model.
Definition: HMM.h:371

SHOGUN 机器学习工具包 - 项目文档