Almost complete KDB

This commit is contained in:
2023-07-13 03:44:33 +02:00
parent 8b0aa5ccfb
commit 786d781e29
4 changed files with 51 additions and 7 deletions

View File

@@ -30,7 +30,7 @@ namespace bayesnet {
}
return result;
}
vector<float> Metrics::conditionalEdgeWeights()
torch::Tensor Metrics::conditionalEdge()
{
auto result = vector<double>();
auto source = vector<string>(features);
@@ -65,6 +65,11 @@ namespace bayesnet {
matrix[x][y] = result[i];
matrix[y][x] = result[i];
}
return matrix;
}
vector<float> Metrics::conditionalEdgeWeights()
{
auto matrix = conditionalEdge();
std::vector<float> v(matrix.data_ptr<float>(), matrix.data_ptr<float>() + matrix.numel());
return v;
}