SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
structure
HMSVMModel.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) 2012 Fernando Jose Iglesias Garcia
8
* Copyright (C) 2012 Fernando Jose Iglesias Garcia
9
*/
10
11
#ifndef _HMSVM_MODEL__H__
12
#define _HMSVM_MODEL__H__
13
14
#include <
shogun/structure/StructuredModel.h
>
15
#include <
shogun/structure/SequenceLabels.h
>
16
#include <
shogun/structure/StateModelTypes.h
>
17
#include <
shogun/structure/StateModel.h
>
18
19
namespace
shogun
20
{
21
22
enum
EStateModelType
;
23
29
class
CHMSVMModel
:
public
CStructuredModel
30
{
31
public
:
33
CHMSVMModel
();
34
43
CHMSVMModel
(
CFeatures
* features,
CStructuredLabels
* labels,
EStateModelType
smt, int32_t num_obs=0,
bool
use_plifs=
false
);
44
46
virtual
~CHMSVMModel
();
47
52
virtual
int32_t
get_dim
()
const
;
53
66
virtual
SGVector< float64_t >
get_joint_feature_vector
(int32_t feat_idx,
CStructuredData
* y);
67
81
virtual
CResultSet
*
argmax
(
SGVector< float64_t >
w, int32_t feat_idx,
bool
const
training =
true
);
82
90
virtual
float64_t
delta_loss
(
CStructuredData
* y1,
CStructuredData
* y2);
91
104
virtual
void
init_primal_opt
(
105
float64_t
regularization,
106
SGMatrix< float64_t >
& A,
SGVector< float64_t >
a,
107
SGMatrix< float64_t >
B,
SGVector< float64_t >
& b,
108
SGVector< float64_t >
lb,
SGVector< float64_t >
ub,
109
SGMatrix < float64_t >
& C);
110
115
virtual
bool
check_training_setup
()
const
;
116
125
virtual
int32_t
get_num_aux
()
const
;
126
134
virtual
int32_t
get_num_aux_con
()
const
;
135
140
void
set_use_plifs
(
bool
use_plifs);
141
147
virtual
void
init_training
();
148
153
SGMatrix< float64_t >
get_transmission_weights
()
const
;
154
159
SGVector< float64_t >
get_emission_weights
()
const
;
160
165
CStateModel
*
get_state_model
()
const
;
166
171
virtual
const
char
*
get_name
()
const
{
return
"HMSVMModel"
; }
172
173
private
:
174
/* internal initialization */
175
void
init();
176
177
private
:
179
int32_t m_num_obs;
180
182
int32_t m_num_aux;
183
185
CStateModel
* m_state_model;
186
188
SGMatrix< float64_t >
m_transmission_weights;
189
191
SGVector< float64_t >
m_emission_weights;
192
194
int32_t m_num_plif_nodes;
195
197
CDynamicObjectArray
* m_plif_matrix;
198
200
bool
m_use_plifs;
201
202
};
/* class CHMSVMModel */
203
204
}
/* namespace shogun */
205
206
#endif
/* _HMSVM_MODEL__H__ */
SHOGUN
机器学习工具包 - 项目文档