SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
structure
SOSVMHelper.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 Shell Hu
8
* Copyright (C) 2013 Shell Hu
9
*/
10
11
#ifndef __SOSVM_HELPER_H__
12
#define __SOSVM_HELPER_H__
13
14
#include <
shogun/base/SGObject.h
>
15
#include <
shogun/lib/SGVector.h
>
16
#include <
shogun/structure/StructuredModel.h
>
17
18
namespace
shogun
19
{
20
29
class
CSOSVMHelper
:
public
CSGObject
30
{
31
public
:
33
CSOSVMHelper
();
34
39
CSOSVMHelper
(int32_t bufsize);
40
42
virtual
~CSOSVMHelper
();
43
45
virtual
const
char
*
get_name
()
const
{
return
"SOSVMHelper"
; }
46
55
static
float64_t
primal_objective
(
SGVector<float64_t>
w,
CStructuredModel
* model,
float64_t
lbda);
56
66
static
float64_t
dual_objective
(
SGVector<float64_t>
w,
float64_t
b_alpha,
float64_t
lbda);
67
74
static
float64_t
average_loss
(
SGVector<float64_t>
w,
CStructuredModel
* model);
75
84
virtual
void
add_debug_info
(
float64_t
primal,
float64_t
eff_pass,
float64_t
train_error,
85
float64_t
dual = -1,
float64_t
dgap = -1);
86
91
SGVector<float64_t>
get_primal_values
()
const
;
92
97
SGVector<float64_t>
get_dual_values
()
const
;
98
103
SGVector<float64_t>
get_duality_gaps
()
const
;
104
109
SGVector<float64_t>
get_eff_passes
()
const
;
110
115
SGVector<float64_t>
get_train_errors
()
const
;
116
119
void
terminate
();
120
121
private
:
123
void
init();
124
125
private
:
127
SGVector<float64_t>
m_primal;
128
130
SGVector<float64_t>
m_dual;
131
133
SGVector<float64_t>
m_duality_gap;
134
136
SGVector<float64_t>
m_eff_pass;
137
139
SGVector<float64_t>
m_train_error;
140
142
int32_t m_tracker;
143
145
int32_t m_bufsize;
146
147
};
/* CSOSVMHelper */
148
149
}
/* namespace shogun */
150
151
#endif
SHOGUN
机器学习工具包 - 项目文档