SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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/lib/config.h>
19 
20 #include <shogun/base/SGObject.h>
21 #include <shogun/base/DynArray.h>
22 #include <shogun/lib/DataType.h>
23 #include <shogun/lib/common.h>
24 #include <shogun/lib/v_array.h>
26 
27 namespace shogun
28 {
29 
42 {
43 public:
49 
53  virtual ~CVwEnvironment() { }
54 
59  inline void set_num_bits(vw_size_t bits) { num_bits = bits; }
60 
65  inline vw_size_t get_num_bits() { return num_bits; }
66 
71  inline void set_mask(vw_size_t m) { mask = m; }
72 
77  inline vw_size_t get_mask() { return mask; }
78 
83  inline float64_t get_min_label() { return min_label; }
84 
89  inline float64_t get_max_label() { return max_label; }
90 
95  inline vw_size_t num_threads() { return 1 << thread_bits; }
96 
101  inline vw_size_t length() { return 1 << num_bits; }
102 
109  void set_stride(vw_size_t new_stride);
110 
116  virtual const char* get_name() const { return "VwEnvironment"; }
117 
118 private:
122  virtual void init();
123 
124 public:
135 
140 
145 
147  bool adaptive;
152 
157 
160 
167 
169  int64_t example_number;
184 
189 
193  bool ignore[256];
194 
197 
199  const char* vw_version;
202 };
203 
204 }
205 #endif // _VW_ENV_H__
uint32_t vw_size_t
vw_size_t typedef to work across platforms
Definition: vw_constants.h:26
float64_t initial_t
Initial value of t.
float64_t weighted_examples
Weighted examples.
void set_mask(vw_size_t m)
Definition: VwEnvironment.h:71
vw_size_t get_num_bits()
Definition: VwEnvironment.h:65
float64_t get_min_label()
Definition: VwEnvironment.h:83
bool random_weights
Whether to use random weights.
Class CVwEnvironment is the environment used by VW.
Definition: VwEnvironment.h:41
void set_stride(vw_size_t new_stride)
float64_t min_label
Smallest label seen.
int64_t example_number
Example number.
float32_t l1_regularization
Level of L1 regularization.
vw_size_t num_bits
log_2 of the number of features
float32_t eta
Learning rate.
float64_t max_label
Largest label seen.
void set_num_bits(vw_size_t bits)
Definition: VwEnvironment.h:59
float32_t update_sum
Sum of updates.
bool exact_adaptive_norm
Whether exact norm is used for adaptive learning.
float64_t get_max_label()
Definition: VwEnvironment.h:89
float32_t power_t
t power value while updating
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
float64_t weighted_labels
Weighted labels.
vw_size_t ngram
ngrams to generate
float32_t eta_decay_rate
Decay rate of eta per pass.
bool ignore_some
Whether some namespaces are ignored.
double float64_t
Definition: common.h:50
DynArray< char * > pairs
Pairs of features to cross for quadratic updates.
vw_size_t num_passes
Number of passes.
vw_size_t stride
Number of elements in weight vector per feature.
vw_size_t skips
Skips in ngrams.
float32_t t
Value of t.
vw_size_t mask
Mask used for hashing.
vw_size_t total_features
Total number of features.
float float32_t
Definition: common.h:49
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
vw_size_t thread_bits
log_2 of the number of threads
float32_t initial_weight
Initial value of all elements in weight vector.
const char * vw_version
VW version.
virtual const char * get_name() const
float64_t weighted_unlabeled_examples
Weighted unlabelled examples.
vw_size_t thread_mask
Mask used by regressor for learning.
bool adaptive
Whether adaptive learning is used.
vw_size_t passes_complete
Number of passes complete.
bool ignore[256]
Which namespaces to ignore.
vw_size_t v_length
Length of version string.
float64_t sum_loss
Sum of losses.

SHOGUN Machine Learning Toolbox - Documentation