Refactor grid input hyperparameter file

This commit is contained in:
2023-11-29 18:24:34 +01:00
parent e3f6dc1e0b
commit dee9c674da
6 changed files with 120 additions and 87 deletions

View File

@@ -7,17 +7,20 @@
namespace platform {
using json = nlohmann::json;
const std::string ALL_DATASETS = "all";
class GridData {
public:
explicit GridData(const std::string& fileName);
~GridData() = default;
std::vector<json> getGrid();
int getNumCombinations();
json& getInputGrid();
std::vector<json> getGrid(const std::string& dataset = ALL_DATASETS);
int getNumCombinations(const std::string& dataset = ALL_DATASETS);
json& getInputGrid(const std::string& dataset = ALL_DATASETS);
std::map<std::string, json>& getGridFile() { return grid; }
private:
std::string decide_dataset(const std::string& dataset);
json generateCombinations(json::iterator index, const json::iterator last, std::vector<json>& output, json currentCombination);
int computeNumCombinations(const json& line);
json grid;
std::map<std::string, json> grid;
};
} /* namespace platform */
#endif /* GRIDDATA_H */