6 #ifndef DOMAINNETMAPIMP_HPP_INCLUDE
7 #define DOMAINNETMAPIMP_HPP_INCLUDE
14 #include "geopm/json11.hpp"
33 int domain_index, PlatformIO &plat_io,
34 std::shared_ptr<NNFactory> nn_factory);
39 std::vector<std::string>
trace_names()
const override;
48 std::map<std::string, double>
last_output()
const override;
51 std::shared_ptr<DenseLayer> json_to_DenseLayer(
const json11::Json &obj)
const;
52 TensorOneD json_to_TensorOneD(
const json11::Json &obj)
const;
53 TensorTwoD json_to_TensorTwoD(
const json11::Json &obj)
const;
55 PlatformIO &m_platform_io;
56 std::shared_ptr<NNFactory> m_nn_factory;
64 struct m_delta_signal_s
70 double signal_num_last;
71 double signal_den_last;
74 static const std::set<std::string> M_EXPECTED_KEYS;
76 static constexpr
int M_MAX_NNET_SIZE = 1024 * 1024;
77 std::shared_ptr<LocalNeuralNet> m_neural_net;
80 std::vector<m_signal_s> m_signal_inputs;
81 std::vector<m_delta_signal_s> m_delta_inputs;
82 std::vector<std::string> m_trace_outputs;
Class to load neural net from file, sample signals specified in that file, feed those signals into th...
Definition: DomainNetMap.hpp:22
Definition: DomainNetMapImp.hpp:27
std::vector< double > trace_values() const override
Populates trace values from last_output for each index within each domain type. In this case,...
Definition: DomainNetMap.cpp:328
std::map< std::string, double > last_output() const override
Populates a map of trace names to the latest output from the neural net. In this case,...
Definition: DomainNetMap.cpp:335
std::vector< std::string > trace_names() const override
Generates the names for trace columns from the appropriate field in the neural net.
Definition: DomainNetMap.cpp:323
void sample() override
Samples latest signals for a specific domain and applies the resulting TensorOneD state to the neural...
Definition: DomainNetMap.cpp:302
DomainNetMapImp(const std::string &nn_path, geopm_domain_e domain_type, int domain_index)
Definition: DomainNetMap.cpp:40
Class to store and perform operations on 1D Tensors, aka vectors, suitable for use in feed-forward ne...
Definition: TensorOneD.hpp:21
Class to manage data and operations related to 2D Tensors required for neural net inference.
Definition: TensorTwoD.hpp:22
Definition: Accumulator.cpp:12