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:
Diffstat (limited to 'vowpalwabbit/loss_functions.cc')
-rw-r--r--vowpalwabbit/loss_functions.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/vowpalwabbit/loss_functions.cc b/vowpalwabbit/loss_functions.cc
index 0cdc5fa7..4d67ae5e 100644
--- a/vowpalwabbit/loss_functions.cc
+++ b/vowpalwabbit/loss_functions.cc
@@ -127,7 +127,8 @@ public:
}
float getLoss(shared_data*, float prediction, float label) {
- assert(label == -1.f || label == 1.f);
+ if (label != -1.f && label != 1.f)
+ cout << "You are using a label not -1 or 1 with a loss function expecting that!" << endl;
float e = 1 - label*prediction;
return (e > 0) ? e : 0;
}
@@ -170,7 +171,8 @@ public:
}
float getLoss(shared_data*, float prediction, float label) {
- assert(label == -1.f || label == 1.f || label == FLT_MAX);
+ if (label != -1.f && label != 1.f)
+ cout << "You are using a label not -1 or 1 with a loss function expecting that!" << endl;
return log(1 + exp(-label * prediction));
}