SHOGUN  v3.2.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 
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 
15 #include <shogun/lib/SGVector.h>
18 
19 namespace shogun
20 {
21 
22 class CSequenceLabels;
23 
26 class CSequence : public CStructuredData
27 {
28 public:
31 
37 
39  ~CSequence() { }
40 
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:
64 
65 };
66 
72 {
73  public:
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 
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__ */
Base class of the labels used in Structured Output (SO) problems.
virtual const char * get_name() const
SGVector< int32_t > data
Class CSequenceLabels used e.g. in the application of Structured Output (SO) learning to Hidden Marko...
Class CSequence to be used in the application of Structured Output (SO) learning to Hidden Markov Sup...
virtual const char * get_name() const
virtual EStructuredDataType get_structured_data_type() const
void add_vector_label(SGVector< int32_t > label)
int32_t get_num_states() const
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:16
#define SG_SERROR(...)
Definition: SGIO.h:181
STRUCTURED_DATA_TYPE(SDT_SEQUENCE)
CSequence(SGVector< int32_t > seq=SGVector< int32_t >())
SGVector< int32_t > get_data() const
static CSequence * obtain_from_generic(CStructuredData *base_data)
Base class of the components of StructuredLabels.

SHOGUN Machine Learning Toolbox - Documentation