18#include <nlohmann/json.hpp>
23namespace MultiProcess {
39 char const *
digits =
"0123456789";
41 std::vector<std::pair<int, std::string>>
pair_vec;
43 std::size_t
const n =
el.find_first_of(
digits);
49 for (
size_t i = 0; i <
task_names.size(); i++) {
56 for (
auto &&
el : durations.
items()) {
57 if (
el.key().find(
"eval_partition") != std::string::npos)
60 for (
size_t idx = 0; idx < durations[
el.key()].
size(); idx += 2) {
61 if (durations[
el.key()][idx] <=
start_t && durations[
el.key()][idx + 1] >=
end_t) {
96 : jsonData_{std::make_unique<Detail::HeatmapAnalyzerJsonData>()}
102 if (std::string(file->GetName()).find(
"p_") == std::string::npos)
105 std::ifstream
f(
logs_dir +
"/" + std::string(file->GetName()));
107 if (std::string(file->GetName()).find(
"999") != std::string::npos) {
108 jsonData_->gradients = nlohmann::json::parse(
f);
110 jsonData_->durations.push_back(nlohmann::json::parse(
f));
116 if (
el.key().find(
"eval_task") != std::string::npos &&
119 }
else if (
el.key().find(
"eval_partition") != std::string::npos &&
123 }
else if (
el.key().find(
"metadata") != std::string::npos) {
203 for (std::size_t i = 0; i !=
tasks_names_.size(); ++i) {
204 y->SetBinLabel(i + 1,
jsonData_->metadata[0][i].get<std::string>().c_str());
205 y->ChangeLabel(i + 1, 30, 0.01, -1, -1, -1,
"");
209 x->ChangeLabel(i + 1, 30, -1, -1, -1, -1,
"");
211 x->LabelsOption(
"v");
228 std::vector<std::string> out;
230 out.emplace_back(
item.get<std::string>());
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
const_iterator begin() const
const_iterator end() const
std::unique_ptr< TH2I > analyze(int analyzed_gradient)
This method is the main functionality in this class.
std::vector< std::string > const getMetadata()
std::vector< std::string > const getPartitionNames()
std::vector< std::string > const getTaskNames()
HeatmapAnalyzer(std::string const &logs_dir)
HeatmapAnalyzer Constructor.
std::vector< std::string > tasks_names_
std::unique_ptr< Detail::HeatmapAnalyzerJsonData > jsonData_
std::vector< std::string > eval_partitions_names_
Class to manage histogram axis.
Mother of all ROOT objects.
Describes an Operating System directory for the browser.
virtual TList * GetListOfFiles() const
Returns a TList of TSystemFile objects representing the contents of the directory.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
std::vector< nlohmann::json > durations