SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
VwEnvironment.cpp
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 
16 
17 using namespace shogun;
18 
20  : CSGObject(), vw_version("5.1"), v_length(4)
21 {
22  init();
23 }
24 
25 void CVwEnvironment::init()
26 {
27  num_bits = 18;
28  thread_bits = 0;
29  mask = (1 << num_bits) - 1;
30  stride = 1;
31 
32  min_label = 0.;
33  max_label = 1.;
34 
35  eta = 10.;
36  eta_decay_rate = 1.;
37 
38  adaptive = false;
39  exact_adaptive_norm = false;
40  l1_regularization = 0.;
41 
42  random_weights = false;
43  initial_weight = 0.;
44 
45  update_sum = 0.;
46 
47  t = 1.;
48  initial_t = 1.;
49  power_t = 0.5;
50 
51  example_number = 0;
52  weighted_examples = 0.;
54  weighted_labels = 0.;
55  total_features = 0;
56  sum_loss = 0.;
57  passes_complete = 0;
58  num_passes = 1;
59 
60  ngram = 0;
61  skips = 0;
62 
63  ignore_some = false;
64 
65  vw_size_t len = ((vw_size_t) 1) << num_bits;
66  thread_mask = (stride * (len >> thread_bits)) - 1;
67 }
68 
70 {
71  stride = new_stride;
72  vw_size_t len = ((vw_size_t) 1) << num_bits;
73  thread_mask = (stride * (len >> thread_bits)) - 1;
74 }
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.
bool random_weights
Whether to use random weights.
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.
float32_t update_sum
Sum of updates.
bool exact_adaptive_norm
Whether exact norm is used for adaptive learning.
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.
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.
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.
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.
float64_t sum_loss
Sum of losses.

SHOGUN Machine Learning Toolbox - Documentation