SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
SequenceLabels.cpp
浏览该文件的文档.
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 
12 
13 using namespace shogun;
14 
17 {
18 }
19 
20 CSequenceLabels::CSequenceLabels(int32_t num_labels, int32_t num_states)
21 : CStructuredLabels(num_labels), m_num_states(num_states)
22 {
23  init();
24 }
25 
27  int32_t num_labels, int32_t num_states)
28 : CStructuredLabels(num_labels), m_num_states(num_states)
29 {
30  REQUIRE(labels.vlen == label_length*num_labels, "The length of the labels must be "
31  "equal to label_length times num_labels\n");
32  init();
33 
34  for ( int32_t i = 0 ; i < labels.vlen ; i += label_length )
35  {
37  SGVector< int32_t >::clone_vector(labels.vector+i, label_length),
38  label_length));
39  }
40 }
41 
43 {
44 }
45 
47 {
49 }
50 
51 void CSequenceLabels::init()
52 {
53  SG_ADD(&m_num_states, "m_num_states", "Number of states", MS_NOT_AVAILABLE);
54 }
Base class of the labels used in Structured Output (SO) problems.
#define REQUIRE(x,...)
Definition: SGIO.h:206
Class CSequence to be used in the application of Structured Output (SO) learning to Hidden Markov Sup...
index_t vlen
Definition: SGVector.h:494
void add_vector_label(SGVector< int32_t > label)
virtual void add_label(CStructuredData *label)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
#define SG_ADD(...)
Definition: SGObject.h:81

SHOGUN 机器学习工具包 - 项目文档