Class to load neural net from file, sample signals specified in that file, feed those signals into the neural net and manage the output from the neural nets.
More...
#include <DomainNetMap.hpp>
|
virtual | ~DomainNetMap ()=default |
|
virtual void | sample ()=0 |
| Samples latest signals for a specific domain and applies the resulting TensorOneD state to the neural net. More...
|
|
virtual std::vector< std::string > | trace_names () const =0 |
| generates the names for trace columns from the appropriate field in the neural net More...
|
|
virtual std::vector< double > | trace_values () const =0 |
| Populates trace values from last_output for each index within each domain type. More...
|
|
virtual std::map< std::string, double > | last_output () const =0 |
| Populates a map of trace names to the latest output from the neural net. More...
|
|
|
static std::unique_ptr< DomainNetMap > | make_unique (const std::string &nn_path, geopm_domain_e domain_type, int domain_index) |
| Returns a unique_ptr to a concrete object constructed using the underlying implementation which loads neural net for a specified domain from a json file. More...
|
|
static std::shared_ptr< DomainNetMap > | make_shared (const std::string &nn_path, geopm_domain_e domain_type, int domain_index) |
| Returns a shared_ptr to a concrete object constructed using the underlying implementation which loads neural net for a specified domain from a json file. More...
|
|
Class to load neural net from file, sample signals specified in that file, feed those signals into the neural net and manage the output from the neural nets.
◆ ~DomainNetMap()
virtual geopm::DomainNetMap::~DomainNetMap |
( |
| ) |
|
|
virtualdefault |
◆ last_output()
virtual std::map<std::string, double> geopm::DomainNetMap::last_output |
( |
| ) |
const |
|
pure virtual |
Populates a map of trace names to the latest output from the neural net.
- Returns
- A map of string, double containing trace names and latest nn output
Implemented in geopm::DomainNetMapImp.
◆ make_shared()
std::shared_ptr< DomainNetMap > geopm::DomainNetMap::make_shared |
( |
const std::string & |
nn_path, |
|
|
geopm_domain_e |
domain_type, |
|
|
int |
domain_index |
|
) |
| |
|
static |
Returns a shared_ptr to a concrete object constructed using the underlying implementation which loads neural net for a specified domain from a json file.
- Parameters
-
[in] | nn_path | Path to neural net json |
[in] | domain_type | Domain type, defined by geopm_domain_e enum |
[in] | domain_index | Index of the domain to be measured |
- Exceptions
-
geopm::Exception | if unable to open neural net file |
geopm::Exception | if neural net file exceeds max size (currently 1024) |
geopm::Exception | if neural net file does not contain a key "layers" or if "layers" does not contain an array |
geopm::Exception | if neural net file does not contain either a non-empty array "signal_inputs" or a non-empty array "delta_inputs" |
◆ make_unique()
std::unique_ptr< DomainNetMap > geopm::DomainNetMap::make_unique |
( |
const std::string & |
nn_path, |
|
|
geopm_domain_e |
domain_type, |
|
|
int |
domain_index |
|
) |
| |
|
static |
Returns a unique_ptr to a concrete object constructed using the underlying implementation which loads neural net for a specified domain from a json file.
- Parameters
-
[in] | nn_path | Path to neural net json |
[in] | domain_type | Domain type, defined by geopm_domain_e enum |
[in] | domain_index | Index of the domain to be measured |
- Exceptions
-
geopm::Exception | if unable to open neural net file |
geopm::Exception | if neural net file exceeds max size (currently 1024) |
geopm::Exception | if neural net file does not contain a key "layers" or if "layers" does not contain an array |
geopm::Exception | if neural net file does not contain either a non-empty array "signal_inputs" or a non-empty array "delta_inputs" |
◆ sample()
virtual void geopm::DomainNetMap::sample |
( |
| ) |
|
|
pure virtual |
◆ trace_names()
virtual std::vector<std::string> geopm::DomainNetMap::trace_names |
( |
| ) |
const |
|
pure virtual |
generates the names for trace columns from the appropriate field in the neural net
Implemented in geopm::DomainNetMapImp.
◆ trace_values()
virtual std::vector<double> geopm::DomainNetMap::trace_values |
( |
| ) |
const |
|
pure virtual |
Populates trace values from last_output for each index within each domain type.
- Returns
- Returns a vector of doubles containing trace values
Implemented in geopm::DomainNetMapImp.
The documentation for this class was generated from the following files: