SHOGUN
v2.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
structure
HMSVMModel.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) 2012 Fernando José Iglesias García
8
* Copyright (C) 2012 Fernando José Iglesias García
9
*/
10
11
#ifndef _HMSVM_MODEL__H__
12
#define _HMSVM_MODEL__H__
13
14
#include <
shogun/structure/StructuredModel.h
>
15
#include <
shogun/structure/HMSVMLabels.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
42
CHMSVMModel
(
CFeatures
* features,
CStructuredLabels
* labels,
EStateModelType
smt, int32_t num_obs);
43
45
virtual
~CHMSVMModel
();
46
51
virtual
int32_t
get_dim
()
const
;
52
65
virtual
SGVector< float64_t >
get_joint_feature_vector
(int32_t feat_idx,
CStructuredData
* y);
66
80
virtual
CResultSet
*
argmax
(
SGVector< float64_t >
w, int32_t feat_idx,
bool
const
training =
true
);
81
89
virtual
float64_t
delta_loss
(
CStructuredData
* y1,
CStructuredData
* y2);
90
101
virtual
void
init_opt
(
102
SGMatrix< float64_t >
& A,
SGVector< float64_t >
a,
103
SGMatrix< float64_t >
B,
SGVector< float64_t >
& b,
104
SGVector< float64_t >
lb,
SGVector< float64_t >
ub,
105
SGMatrix < float64_t >
& C);
106
111
virtual
bool
check_training_setup
()
const
;
112
121
virtual
int32_t
get_num_aux
()
const
;
122
130
virtual
int32_t
get_num_aux_con
()
const
;
131
132
private
:
133
/* internal initialization */
134
void
init();
135
136
private
:
138
int32_t m_num_states;
139
141
int32_t m_num_obs;
142
144
int32_t m_num_aux;
145
147
CStateModel
* m_state_model;
148
150
SGMatrix< float64_t >
m_transmission_weights;
151
153
SGVector< float64_t >
m_emission_weights;
154
155
};
/* class CHMSVMModel */
156
157
}
/* namespace shogun */
158
159
#endif
/* _HMSVM_MODEL__H__ */
SHOGUN
Machine Learning Toolbox - Documentation