ATLAS Offline Software
Loading...
Searching...
No Matches
AthExTriton/src/EvaluateUtils.h
Go to the documentation of this file.
1// Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3#ifndef ATHEXTRITON_EVALUATEUTILS_H
4#define ATHEXTRITON_EVALUATEUTILS_H
5
6#include <format>
7#include <string>
8#include <vector>
9
10namespace EvaluateUtils {
11//*******************************************************************
12// for reading MNIST images
13std::vector<std::vector<std::vector<float>>> read_mnist_pixel_notFlat(
14 const std::string& full_path);
15
16// flatten a vector of vectors into a vector
17std::vector<float> flattenNestedVectors(
18 const std::vector<std::vector<float>>& nestedVector);
19 inline auto spanToString = [](std::span<const float> s) {
20 std::string out;
21 for (float v : s) out += std::format("{:.2e} ", v);
22 if (!out.empty()) out.pop_back();
23 return out;
24 };
25} // namespace EvaluateUtils
26
27#endif // ATHEXTRITON_EVALUATEUTILS_H
std::vector< std::vector< std::vector< float > > > read_mnist_pixel_notFlat(const std::string &full_path)
std::vector< float > flattenNestedVectors(const std::vector< std::vector< float > > &nestedVector)