Commit dcd322dd authored by Davis King's avatar Davis King

Made this code slightly more robust.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403046
parent 56901135
......@@ -5,6 +5,7 @@
#include "roc_trainer_abstract.h"
#include "../algs.h"
#include <limits>
namespace dlib
{
......@@ -101,6 +102,16 @@ namespace dlib
df.b = scores[idx];
// In this case add a very small extra amount to the bias so that all the samples
// with the class_selection label are classified correctly.
if (desired_accuracy == 1)
{
if (class_selection == +1)
df.b -= std::numeric_limits<scalar_type>::epsilon()*df.b;
else
df.b += std::numeric_limits<scalar_type>::epsilon()*df.b;
}
return df;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment