SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
structure
MulticlassModel.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) 2013 Thoralf Klein
8
* Written (W) 2012 Fernando José Iglesias García
9
* Copyright (C) 2012 Fernando José Iglesias García
10
*/
11
12
#ifndef _MULTICLASS_MODEL__H__
13
#define _MULTICLASS_MODEL__H__
14
15
#include <
shogun/structure/StructuredModel.h
>
16
17
namespace
shogun
18
{
19
25
class
CMulticlassModel
:
public
CStructuredModel
26
{
27
28
public
:
30
CMulticlassModel
();
31
37
CMulticlassModel
(
CFeatures
* features,
CStructuredLabels
* labels);
38
40
virtual
~CMulticlassModel
();
41
43
virtual
CStructuredLabels
*
structured_labels_factory
(int32_t num_labels=0);
44
49
virtual
int32_t
get_dim
()
const
;
50
63
virtual
SGVector< float64_t >
get_joint_feature_vector
(int32_t feat_idx,
CStructuredData
* y);
64
78
virtual
CResultSet
*
argmax
(
SGVector< float64_t >
w, int32_t feat_idx,
bool
const
training =
true
);
79
87
virtual
float64_t
delta_loss
(
CStructuredData
* y1,
CStructuredData
* y2);
88
101
virtual
void
init_primal_opt
(
102
float64_t
regularization,
103
SGMatrix< float64_t >
& A,
SGVector< float64_t >
a,
104
SGMatrix< float64_t >
B,
SGVector< float64_t >
& b,
105
SGVector< float64_t >
lb,
SGVector< float64_t >
ub,
106
SGMatrix < float64_t >
& C);
107
109
virtual
const
char
*
get_name
()
const
{
return
"MulticlassModel"
; }
110
111
private
:
112
void
init();
113
115
float64_t
delta_loss
(
float64_t
y1,
float64_t
y2);
116
float64_t
delta_loss
(int32_t y1_idx,
float64_t
y2);
117
118
private
:
120
int32_t m_num_classes;
121
122
};
/* MulticlassModel */
123
124
}
/* namespace shogun */
125
126
#endif
/* _MULTICLASS_MODEL__H__ */
SHOGUN
机器学习工具包 - 项目文档