Forbids to insert the same edge twice

This commit is contained in:
2024-07-04 18:52:41 +02:00
parent 6fcc15d39a
commit 26eb58b104
8 changed files with 56 additions and 7 deletions

View File

@@ -119,6 +119,7 @@ namespace bayesnet {
cpTable.index_put_({ coordinates }, cpTable.index({ coordinates }) + weights.index({ n_sample }).item<double>());
}
// Normalize the counts
// Divide each row by the sum of the row
cpTable = cpTable / cpTable.sum(0);
}
float Node::getFactorValue(std::map<std::string, int>& evidence)