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
StateModel.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 __STATE_MODEL_H__
12
#define __STATE_MODEL_H__
13
14
#include <
shogun/base/SGObject.h
>
15
#include <
shogun/lib/SGMatrix.h
>
16
#include <
shogun/lib/SGVector.h
>
17
#include <
shogun/mathematics/Math.h
>
18
#include <
shogun/structure/HMSVMLabels.h
>
19
#include <
shogun/structure/StateModelTypes.h
>
20
21
namespace
shogun
22
{
23
28
class
CStateModel
:
public
CSGObject
29
{
30
public
:
32
CStateModel
();
33
35
virtual
~CStateModel
();
36
38
int32_t
get_num_states
()
const
;
39
41
int32_t
get_num_transmission_params
()
const
;
42
53
virtual
SGMatrix< float64_t >
loss_matrix
(
CSequence
* label_seq) = 0;
54
64
virtual
float64_t
loss
(
CSequence
* label_seq_lhs,
CSequence
* label_seq_rhs) = 0;
65
77
virtual
void
reshape_emission_params
(
SGVector< float64_t >
& emission_weights,
78
SGVector< float64_t >
w, int32_t num_feats, int32_t num_obs) = 0;
79
88
virtual
void
reshape_transmission_params
(
89
SGMatrix< float64_t >
& transmission_weights,
90
SGVector< float64_t >
w) = 0;
91
98
virtual
SGVector< int32_t >
labels_to_states
(
CSequence
* label_seq)
const
= 0;
99
106
virtual
CSequence
*
states_to_labels
(
SGVector< int32_t >
state_seq)
const
= 0;
107
121
virtual
void
weights_to_vector
(
SGVector< float64_t >
& psi,
122
SGMatrix< float64_t >
transmission_weights,
123
SGVector< float64_t >
emission_weights,
124
int32_t num_feats, int32_t num_obs)
const
= 0;
125
144
virtual
SGVector< int32_t >
get_monotonicity
(int32_t num_free_states,
145
int32_t num_feats)
const
;
146
162
SGVector< float64_t >
get_start_states
()
const
;
163
179
SGVector< float64_t >
get_stop_states
()
const
;
180
182
virtual
const
char
*
get_name
()
const
{
return
"StateModel"
; }
183
184
private
:
186
void
init();
187
188
protected
:
190
int32_t
m_num_states
;
191
193
int32_t
m_num_transmission_params
;
194
196
SGMatrix< float64_t >
m_state_loss_mat
;
197
199
SGVector< float64_t >
m_p
;
200
202
SGVector< float64_t >
m_q
;
203
204
};
/* class CStateModel */
205
206
}
/* namespace shogun */
207
208
#endif
/* __STATE_MODEL_H__ */
SHOGUN
Machine Learning Toolbox - Documentation