SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 }

SHOGUN Machine Learning Toolbox - Documentation