Fix json key automatic ordering error when creating Score from json

This commit is contained in:
2024-05-12 18:23:48 +02:00
parent 07a2efb298
commit ebaddf1a6c
23 changed files with 81 additions and 43 deletions

View File

@@ -5,7 +5,7 @@
#include <torch/torch.h>
#include <nlohmann/json.hpp>
namespace platform {
using json = nlohmann::json;
using json = nlohmann::ordered_json;
class Scores {
public:
Scores(torch::Tensor& y_test, torch::Tensor& y_pred, int num_classes, std::vector<std::string> labels = {});
@@ -24,6 +24,7 @@ namespace platform {
std::string classification_report_line(std::string label, float precision, float recall, float f1_score, int support);
void init_confusion_matrix();
void init_default_labels();
void compute_accuracy_value();
int num_classes;
float accuracy_value;
int total;