SHOGUN
v3.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/SequenceLabels.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
90
virtual
void
reshape_emission_params
(
CDynamicObjectArray
* plif_matrix,
91
SGVector< float64_t >
w, int32_t num_feats, int32_t num_plif_nodes) = 0;
92
101
virtual
void
reshape_transmission_params
(
102
SGMatrix< float64_t >
& transmission_weights,
103
SGVector< float64_t >
w) = 0;
104
111
virtual
SGVector< int32_t >
labels_to_states
(
CSequence
* label_seq)
const
= 0;
112
119
virtual
CSequence
*
states_to_labels
(
SGVector< int32_t >
state_seq)
const
= 0;
120
133
virtual
void
weights_to_vector
(
SGVector< float64_t >
& psi,
134
SGMatrix< float64_t >
transmission_weights,
135
SGVector< float64_t >
emission_weights,
136
int32_t num_feats, int32_t num_obs)
const
= 0;
137
150
virtual
SGVector< float64_t >
weights_to_vector
(
SGMatrix< float64_t >
transmission_weights,
151
SGVector< float64_t >
emission_weights, int32_t num_feats, int32_t num_obs)
const
= 0;
152
171
virtual
SGVector< int32_t >
get_monotonicity
(int32_t num_free_states,
172
int32_t num_feats)
const
;
173
189
SGVector< float64_t >
get_start_states
()
const
;
190
206
SGVector< float64_t >
get_stop_states
()
const
;
207
209
virtual
const
char
*
get_name
()
const
{
return
"StateModel"
; }
210
211
private
:
213
void
init();
214
215
protected
:
217
int32_t
m_num_states
;
218
220
int32_t
m_num_transmission_params
;
221
223
SGMatrix< float64_t >
m_state_loss_mat
;
224
226
SGVector< float64_t >
m_p
;
227
229
SGVector< float64_t >
m_q
;
230
231
};
/* class CStateModel */
232
233
}
/* namespace shogun */
234
235
#endif
/* __STATE_MODEL_H__ */
SHOGUN
Machine Learning Toolbox - Documentation