Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/vowpal_wabbit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Langford <jl@hunch.net>2012-05-30 02:04:27 +0400
committerJohn Langford <jl@hunch.net>2012-05-30 02:04:27 +0400
commit6dc3ddde0555059b334e9688552d2d419b07e330 (patch)
tree85491cfaddffb68e440044a959f717572f667f41 /vowpalwabbit/loss_functions.h
parent463f02e4a6b0a4be4bfa8f8e35facc26e4cbdc62 (diff)
nearly all state now addressable
Diffstat (limited to 'vowpalwabbit/loss_functions.h')
-rw-r--r--vowpalwabbit/loss_functions.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/vowpalwabbit/loss_functions.h b/vowpalwabbit/loss_functions.h
index 59ebeae4..f7ba3302 100644
--- a/vowpalwabbit/loss_functions.h
+++ b/vowpalwabbit/loss_functions.h
@@ -8,6 +8,9 @@ embodied in the content of this file are licensed under the BSD
#define LOSSFUNCTIONS_H_
#include <string>
+#include "parse_primitives.h"
+
+using namespace std;
class loss_function {
@@ -17,20 +20,20 @@ public :
* The function returns the loss value
*/
//virtual float getLoss(example *&ec, gd_vars &vars) = 0;
- virtual float getLoss(float prediction, float label) = 0;
+ virtual float getLoss(shared_data*, float prediction, float label) = 0;
/*
* getUpdate evaluates the update scalar
* The function return the update scalar
*/
virtual float getUpdate(float prediction, float label, float eta_t, float norm) = 0;
- virtual float getRevertingWeight(float prediction, float eta_t) = 0;
+ virtual float getRevertingWeight(shared_data*, float prediction, float eta_t) = 0;
virtual float getSquareGrad(float prediction, float label) = 0;
- virtual float first_derivative(float prediction, float label) = 0;
- virtual float second_derivative(float prediction, float label) = 0;
+ virtual float first_derivative(shared_data*, float prediction, float label) = 0;
+ virtual float second_derivative(shared_data*, float prediction, float label) = 0;
virtual ~loss_function() {};
};
-loss_function* getLossFunction(std::string funcName, double loss_parameter = 0);
+loss_function* getLossFunction(shared_data* sd, string funcName, double function_parameter = 0);
#endif /* LOSSFUNCTIONS_H_ */