Including XA1DE model #5

Merged
rmontanana merged 33 commits from XA1DE into main 2025-03-20 14:58:38 +00:00
28 changed files with 4788 additions and 130 deletions
Showing only changes of commit 610c2a6a4a - Show all commits

View File

@@ -46,7 +46,6 @@ namespace platform {
bool debug = false;
Xaode aode_;
torch::Tensor weights_;
bool fitted = false;
const std::string CLASSIFIER_NOT_FITTED = "Classifier has not been fitted";
inline void normalize_weights(int num_instances)
{

View File

@@ -182,7 +182,6 @@ namespace platform {
}
}
}
// -------------------------------------------------------
// computeProbabilities
// -------------------------------------------------------
@@ -257,7 +256,6 @@ namespace platform {
}
matrixState_ = MatrixState::PROBS;
}
// -------------------------------------------------------
// predict_proba_spode
// -------------------------------------------------------
@@ -372,10 +370,7 @@ namespace platform {
}
void normalize(std::vector<double>& probs) const
{
double sum = 0;
for (double d : probs) {
sum += d;
}
double sum = std::accumulate(probs.begin(), probs.end(), 0.0);
if (std::isnan(sum)) {
throw std::runtime_error("Can't normalize array. Sum is NaN.");
}
@@ -420,7 +415,6 @@ namespace platform {
active_parents.pop_back();
}
private:
// -----------
// MEMBER DATA