SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
machine
LinearLatentMachine.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 Viktor Gal
8
* Copyright (C) 2012 Viktor Gal
9
*/
10
11
#ifndef __LATENTLINEARMACHINE_H__
12
#define __LATENTLINEARMACHINE_H__
13
14
#include <
shogun/lib/common.h
>
15
#include <
shogun/machine/LinearMachine.h
>
16
#include <
shogun/latent/LatentModel.h
>
17
18
namespace
shogun
19
{
23
class
CLinearLatentMachine
:
public
CLinearMachine
24
{
25
26
public
:
27
29
MACHINE_PROBLEM_TYPE
(
PT_LATENT
);
30
32
CLinearLatentMachine
();
33
39
CLinearLatentMachine
(
CLatentModel
* model,
float64_t
C);
40
41
virtual
~CLinearLatentMachine
();
42
47
virtual
CLatentLabels
*
apply_latent
() = 0;
48
54
virtual
CLatentLabels
*
apply_latent
(
CFeatures
* data);
55
60
virtual
const
char
*
get_name
()
const
{
return
"LinearLatentMachine"
; }
61
66
inline
void
set_epsilon
(
float64_t
eps) {
m_epsilon
=eps; }
67
72
inline
float64_t
get_epsilon
() {
return
m_epsilon
; }
73
78
inline
void
set_C
(
float64_t
c)
79
{
80
m_C
=c;
81
}
82
87
inline
float64_t
get_C
() {
return
m_C
; }
88
93
inline
void
set_max_iterations
(int32_t iter) {
m_max_iter
= iter; }
94
99
inline
int32_t
get_max_iterations
() {
return
m_max_iter
; }
100
105
void
set_model
(
CLatentModel
* latent_model);
106
107
protected
:
108
virtual
bool
train_machine
(
CFeatures
* data=NULL);
109
116
virtual
float64_t
do_inner_loop
(
float64_t
cooling_eps)=0;
117
118
virtual
bool
train_require_labels
()
const
{
return
false
; }
119
120
protected
:
122
CLatentModel
*
m_model
;
124
float64_t
m_C
;
126
float64_t
m_epsilon
;
128
int32_t
m_max_iter
;
130
int32_t
m_cur_iter
;
131
132
private
:
134
void
init();
135
};
136
}
137
138
#endif
/* __LATENTLINEARMACHINE_H__ */
139
SHOGUN
机器学习工具包 - 项目文档