Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef _VW_MATH_H__
00016 #define _VW_MATH_H__
00017
00018 #include <shogun/lib/common.h>
00019 #include <shogun/mathematics/Math.h>
00020 #include <shogun/classifier/vw/vw_common.h>
00021
00022 namespace shogun
00023 {
00024
00033 inline float32_t real_weight(float32_t w,float32_t gravity)
00034 {
00035 float32_t wprime = 0.;
00036 if (gravity < fabsf(w))
00037 wprime = CMath::sign(w)*(fabsf(w) - gravity);
00038 return wprime;
00039 }
00040
00053 float32_t sd_offset_add(float32_t* weights, vw_size_t mask, VwFeature* begin,
00054 VwFeature* end, vw_size_t offset);
00055
00071 float32_t sd_offset_truncadd(float32_t* weights, vw_size_t mask, VwFeature* begin,
00072 VwFeature* end, vw_size_t offset, float32_t gravity);
00073
00084 float32_t one_pf_quad_predict(float32_t* weights, VwFeature& f,
00085 v_array<VwFeature> &cross_features, vw_size_t mask);
00086
00100 float32_t one_pf_quad_predict_trunc(float32_t* weights, VwFeature& f,
00101 v_array<VwFeature> &cross_features,
00102 vw_size_t mask, float32_t gravity);
00103 }
00104 #endif // _VW_MATH_H__