SHOGUN
v3.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
optimization
liblinear
tron.h
Go to the documentation of this file.
1
#ifndef _CTron_H
2
#define _CTron_H
3
4
#include <
shogun/lib/config.h
>
5
6
#include <
shogun/base/SGObject.h
>
7
8
#ifndef DOXYGEN_SHOULD_SKIP_THIS
9
namespace
shogun
10
{
12
class
function
13
{
14
public
:
22
virtual
float64_t
fun(
float64_t
*w) = 0 ;
23
31
virtual
void
grad(
float64_t
*w,
float64_t
*g) = 0 ;
32
40
virtual
void
Hv(
float64_t
*s,
float64_t
*Hs) = 0 ;
41
48
virtual
int32_t get_nr_variable() = 0 ;
49
50
virtual
~function(){}
51
};
52
#endif // DOXYGEN_SHOULD_SKIP_THIS
53
55
class
CTron
:
public
CSGObject
56
{
57
public
:
58
CTron
() { }
65
CTron
(
66
const
function
*fun_obj,
float64_t
eps = 0.1, int32_t max_iter = 1000);
67
virtual
~
CTron
();
68
74
void
tron(
float64_t
*w,
float64_t
max_train_time);
75
77
virtual
const
char
*
get_name
()
const
{
return
"Tron"
; }
78
79
private
:
80
int32_t trcg(
float64_t
delta
,
double
* g,
double
* s,
double
* r);
81
float64_t
norm_inf(int32_t n,
float64_t
*x);
82
83
float64_t
eps;
84
int32_t max_iter;
85
function
*fun_obj;
86
};
87
}
88
#endif
SHOGUN
Machine Learning Toolbox - Documentation