SHOGUN
v2.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
classifier
vw
VwEnvironment.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 Yahoo! Inc. All rights reserved. The copyrights
3
* embodied in the content of this file are licensed under the BSD
4
* (revised) open source license.
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* Written (W) 2011 Shashwat Lal Das
12
* Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society.
13
*/
14
15
#ifndef _VW_ENV_H__
16
#define _VW_ENV_H__
17
18
#include <
shogun/base/SGObject.h
>
19
#include <
shogun/base/DynArray.h
>
20
#include <
shogun/lib/DataType.h
>
21
#include <
shogun/lib/common.h
>
22
#include <
shogun/lib/v_array.h
>
23
#include <
shogun/classifier/vw/vw_constants.h
>
24
25
namespace
shogun
26
{
27
39
class
CVwEnvironment
:
public
CSGObject
40
{
41
public
:
46
CVwEnvironment
();
47
51
virtual
~CVwEnvironment
() { }
52
57
inline
void
set_num_bits
(
vw_size_t
bits) {
num_bits
= bits; }
58
63
inline
vw_size_t
get_num_bits
() {
return
num_bits
; }
64
69
inline
void
set_mask
(
vw_size_t
m) {
mask
= m; }
70
75
inline
vw_size_t
get_mask
() {
return
mask
; }
76
81
inline
float64_t
get_min_label
() {
return
min_label
; }
82
87
inline
float64_t
get_max_label
() {
return
max_label
; }
88
93
inline
vw_size_t
num_threads
() {
return
1 <<
thread_bits
; }
94
99
inline
vw_size_t
length
() {
return
1 <<
num_bits
; }
100
107
void
set_stride
(
vw_size_t
new_stride);
108
114
virtual
const
char
*
get_name
()
const
{
return
"VwEnvironment"
; }
115
116
private
:
120
virtual
void
init();
121
122
public
:
124
vw_size_t
num_bits
;
126
vw_size_t
thread_bits
;
128
vw_size_t
mask
;
130
vw_size_t
thread_mask
;
132
vw_size_t
stride
;
133
135
float64_t
min_label
;
137
float64_t
max_label
;
138
140
float32_t
eta
;
142
float32_t
eta_decay_rate
;
143
145
bool
adaptive
;
147
bool
exact_adaptive_norm
;
149
float32_t
l1_regularization
;
150
152
bool
random_weights
;
154
float32_t
initial_weight
;
155
157
float32_t
update_sum
;
158
160
float32_t
t
;
162
float64_t
initial_t
;
164
float32_t
power_t
;
165
167
int64_t
example_number
;
169
float64_t
weighted_examples
;
171
float64_t
weighted_unlabeled_examples
;
173
float64_t
weighted_labels
;
175
vw_size_t
total_features
;
177
float64_t
sum_loss
;
179
vw_size_t
passes_complete
;
181
vw_size_t
num_passes
;
182
184
vw_size_t
ngram
;
186
vw_size_t
skips
;
187
189
bool
ignore_some
;
191
bool
ignore
[256];
192
194
DynArray<char*>
pairs
;
195
197
const
char
*
vw_version
;
199
vw_size_t
v_length
;
200
};
201
202
}
203
#endif // _VW_ENV_H__
SHOGUN
Machine Learning Toolbox - Documentation