geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | Static Public Member Functions | List of all members
geopm::DomainNetMap Class Referenceabstract

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>

Inheritance diagram for geopm::DomainNetMap:
Inheritance graph
[legend]

Public Member Functions

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 Public Member Functions

static std::unique_ptr< DomainNetMapmake_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< DomainNetMapmake_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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~DomainNetMap()

virtual geopm::DomainNetMap::~DomainNetMap ( )
virtualdefault

Member Function Documentation

◆ 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_pathPath to neural net json
[in]domain_typeDomain type, defined by geopm_domain_e enum
[in]domain_indexIndex of the domain to be measured
Exceptions
geopm::Exceptionif unable to open neural net file
geopm::Exceptionif neural net file exceeds max size (currently 1024)
geopm::Exceptionif neural net file does not contain a key "layers" or if "layers" does not contain an array
geopm::Exceptionif 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_pathPath to neural net json
[in]domain_typeDomain type, defined by geopm_domain_e enum
[in]domain_indexIndex of the domain to be measured
Exceptions
geopm::Exceptionif unable to open neural net file
geopm::Exceptionif neural net file exceeds max size (currently 1024)
geopm::Exceptionif neural net file does not contain a key "layers" or if "layers" does not contain an array
geopm::Exceptionif 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

Samples latest signals for a specific domain and applies the resulting TensorOneD state to the neural net.

Implemented in geopm::DomainNetMapImp.

◆ 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: