You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6d3e25c
Browse filesBrowse the repository at this point in the historyBrowse files
// Discriminant value. Probability order is assumed to be [b, c, lf].
1202
+
template <typename T>
1203
+
T getDbFromProb(const std::vector<T>& probs, doublefC = 0.018)
1204
+
{
1205
+
// MlResponse::getModelOutput() returns exactly nClassesMl entries, so a mismatched
1206
+
// nClassesMl silently truncates the model output and would read out of bounds here.
1207
+
if (probs.size() < 3) {
1208
+
LOG(fatal) << "getDbFromProb expects 3 class probabilities but received " << probs.size() << ". Set the nClassesMl configurable to 3 (and give cutDirMl 3 entries to match).";
1209
+
}
1210
+
T denominator = fC * probs[1] + (1. - fC) * probs[2];
1211
+
if (probs[0] <= 0. || denominator <= 0.) {
1212
+
return std::numeric_limits<T>::quiet_NaN();
1213
+
}
1214
+
returnstd::log(probs[0] / denominator);
1215
+
}
1216
+
1158
1217
// Discriminant value for GNN b-jet tagging
1159
1218
template <typename T>
1160
1219
T getDb(const std::vector<T>& logits, doublefC = 0.018)
0 commit comments