Bugfix: prevent classification cost from going negative

This commit is contained in:
Simon Giraudot 2017-10-20 15:16:03 +02:00
parent 40e497a6da
commit 34bc6f18e8
1 changed files with 4 additions and 0 deletions

View File

@ -147,7 +147,11 @@ public:
m_rfc->evaluate (ft.data(), prob.data());
for (std::size_t i = 0; i < out.size(); ++ i)
{
out[i] = - std::log (prob[i]);
if (out[i] < 0.f)
out[i] = -out[i];
}
}
void save_configuration (const char* filename)