SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
FactorGraphDataGenerator.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) 2015 Jiaolong Xu
8  * Copyright (C) 2015 Jiaolong Xu
9  */
10 
11 #ifndef __FACTOR_GRAPH_DATA_GENERATOR_H__
12 #define __FACTOR_GRAPH_DATA_GENERATOR_H__
13 
15 #include <shogun/lib/SGVector.h>
16 #include <shogun/lib/SGNDArray.h>
17 #include <shogun/lib/SGMatrix.h>
18 #include <shogun/base/DynArray.h>
19 #include <shogun/base/init.h>
20 #include <shogun/io/SGIO.h>
21 
26 
29 
32 
33 namespace shogun
34 {
38 {
39 public:
42 
44  virtual const char* get_name() const
45  {
46  return "FactorGraphDataGenerator";
47  }
48 
51 
59  int32_t grid_to_index(int32_t x, int32_t y, int32_t w = 10);
60 
69 
77  CFactorGraph* random_chain_graph(SGVector<int> &assignment_expect, float64_t &min_energy_expect, int32_t N = 2);
78 
81 
97  void generate_data(int32_t len_label, int32_t len_feat, int32_t size_data,
98  SGMatrix<float64_t> &feats, SGMatrix<int32_t> &labels);
99 
105  SGMatrix< int32_t > get_edges_full(const int32_t num_classes);
106 
117  SGMatrix< int32_t > edge_list, const DynArray<CTableFactorType*> &v_factor_type,
118  CFactorGraphFeatures* fg_feats, CFactorGraphLabels* fg_labels);
119 
127  void define_factor_types(int32_t num_classes, int32_t dim, int32_t num_edges,
128  DynArray<CTableFactorType*> &v_factor_type);
129 
135  float64_t test_sosvm(EMAPInferType infer_type);
136 };
137 }
138 #endif
void truncate_energy(float64_t &A, float64_t &B, float64_t &C, float64_t &D)
int32_t grid_to_index(int32_t x, int32_t y, int32_t w=10)
SGMatrix< int32_t > get_edges_full(const int32_t num_classes)
CFactorGraph * random_chain_graph(SGVector< int > &assignment_expect, float64_t &min_energy_expect, int32_t N=2)
void build_factor_graph(SGMatrix< float64_t > feats, SGMatrix< int32_t > labels, SGMatrix< int32_t > edge_list, const DynArray< CTableFactorType * > &v_factor_type, CFactorGraphFeatures *fg_feats, CFactorGraphLabels *fg_labels)
Class FactorGraphLabels used e.g. in the application of Structured Output (SO) learning with the Fact...
void define_factor_types(int32_t num_classes, int32_t dim, int32_t num_edges, DynArray< CTableFactorType * > &v_factor_type)
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
Class CFactorGraphDataGenerator Create factor graph data for multiple unit tests. ...
shogun vector
Template Dynamic array class that creates an array that can be used like a list or an array...
Definition: DynArray.h:32
double float64_t
Definition: common.h:50
CFactorGraphFeatures maintains an array of factor graphs, each graph is a sample, i...
void generate_data(int32_t len_label, int32_t len_feat, int32_t size_data, SGMatrix< float64_t > &feats, SGMatrix< int32_t > &labels)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
Class CFactorGraph a factor graph is a structured input in general.
Definition: FactorGraph.h:27
float64_t test_sosvm(EMAPInferType infer_type)
virtual const char * get_name() const

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