SHOGUN  4.1.0
vw_math.h
Go to the documentation of this file.
1 /*
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
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Adaptation of Vowpal Wabbit v5.1.
12  * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society.
13  */
14
15 #ifndef _VW_MATH_H__
16 #define _VW_MATH_H__
17
18 #include <shogun/lib/config.h>
19
20 #include <shogun/lib/common.h>
23
24 namespace shogun
25 {
26
36 {
37  float32_t wprime = 0.;
38  if (gravity < fabsf(w))
39  wprime = CMath::sign(w)*(fabsf(w) - gravity);
40  return wprime;
41 }
42
56  VwFeature* end, vw_size_t offset);
57
74  VwFeature* end, vw_size_t offset, float32_t gravity);
75
86 float32_t one_pf_quad_predict(float32_t* weights, VwFeature& f,
88
102 float32_t one_pf_quad_predict_trunc(float32_t* weights, VwFeature& f,
103  v_array<VwFeature> &cross_features,
105 }
106 #endif // _VW_MATH_H__
uint32_t vw_size_t
vw_size_t typedef to work across platforms
Definition: vw_constants.h:26
Definition: vw_math.cpp:20
float32_t one_pf_quad_predict_trunc(float32_t *weights, VwFeature &f, v_array< VwFeature > &cross_features, vw_size_t mask, float32_t gravity)
Definition: vw_math.cpp:48
float32_t sd_offset_truncadd(float32_t *weights, vw_size_t mask, VwFeature *begin, VwFeature *end, vw_size_t offset, float32_t gravity)
Definition: vw_math.cpp:28
float32_t real_weight(float32_t w, float32_t gravity)
Definition: vw_math.h:35
float float32_t
Definition: common.h:49
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
static T sign(T a)
Definition: Math.h:426