SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
structure
SequenceLabels.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-2013 Fernando José Iglesias García
8
* Copyright (C) 2012-2013 Fernando José Iglesias García
9
*/
10
11
#ifndef _SEQUENCE_LABELS__H__
12
#define _SEQUENCE_LABELS__H__
13
14
#include <
shogun/labels/StructuredLabels.h
>
15
#include <
shogun/lib/SGVector.h
>
16
#include <
shogun/lib/StructuredData.h
>
17
#include <
shogun/lib/StructuredDataTypes.h
>
18
19
namespace
shogun
20
{
21
22
class
CSequenceLabels;
23
26
class
CSequence
:
public
CStructuredData
27
{
28
public
:
30
STRUCTURED_DATA_TYPE
(
SDT_SEQUENCE
);
31
36
CSequence
(
SGVector< int32_t >
seq =
SGVector<int32_t>
()) :
CStructuredData
(),
data
(seq) { }
37
39
~CSequence
() { }
40
45
static
CSequence
*
obtain_from_generic
(
CStructuredData
* base_data)
46
{
47
if
( base_data->
get_structured_data_type
() ==
SDT_SEQUENCE
)
48
return
(
CSequence
*) base_data;
49
else
50
SG_SERROR
(
"base_data must be of dynamic type CSequence\n"
)
51
52
return
NULL;
53
}
54
56
virtual
const
char
*
get_name
()
const
{
return
"Sequence"
; }
57
59
SGVector<int32_t>
get_data
()
const
{
return
data
; }
60
61
protected
:
63
SGVector< int32_t >
data
;
64
65
};
66
71
class
CSequenceLabels
:
public
CStructuredLabels
72
{
73
public
:
75
CSequenceLabels
();
76
82
CSequenceLabels
(int32_t num_labels, int32_t num_states);
83
94
CSequenceLabels
(
SGVector< int32_t >
labels, int32_t label_length, int32_t num_labels, int32_t num_states);
95
97
virtual
~CSequenceLabels
();
98
100
virtual
const
char
*
get_name
()
const
{
return
"SequenceLabels"
; }
101
111
void
add_vector_label
(
SGVector< int32_t >
label);
112
117
inline
int32_t
get_num_states
()
const
{
return
m_num_states; };
118
119
private
:
121
void
init();
122
123
private
:
128
int32_t m_num_states;
129
130
};
/* CSequenceLabels */
131
132
}
/* namespace shogun */
133
134
#endif
/* _SEQUENCE_LABELS__H__ */
SHOGUN
机器学习工具包 - 项目文档