MAGEEC Machine Learner.
More...
#include <mageec-ml.h>
MAGEEC Machine Learner.
Definition at line 37 of file mageec-ml.h.
virtual mageec::mageec_ml::~mageec_ml |
( |
) | |
|
|
inlinevirtual |
void mageec::mageec_ml::add_result |
( |
std::vector< mageec_feature * > |
features, |
|
|
std::vector< mageec_pass * > |
passes, |
|
|
int64_t |
metric, |
|
|
bool |
good |
|
) |
| |
Adds a result to the machine learner database.
(Depending on the algorithm used, this may be for training purposes only)
- Parameters
-
features | List of features for program. |
passes | List of passes executed during compilation. |
metric | Performance metric for optimisation. |
good | Whether the result of compilation was valid (for machine learners that understand bad combinations.) |
void mageec_ml::add_result |
( |
result |
res) | |
|
Adds a result to the machine learner database.
- Parameters
-
res | Result structure containing program, pass and metric info |
Definition at line 89 of file ml.cpp.
std::vector< mageec_pass * > mageec_ml::all_passes |
( |
void |
) | |
|
Returns complete list of passes known to machine learner for disabling upon initialisation.
- Returns
- list of all passes.
Definition at line 67 of file ml.cpp.
void mageec_ml::end_file |
( |
void |
) | |
|
Declares to Machine Learner processing has finished.
Definition at line 55 of file ml.cpp.
void mageec_ml::finish |
( |
void |
) | |
|
Hook for Machine Learner to e.g.
disconnect for any resources.
Definition at line 60 of file ml.cpp.
std::vector<mageec_pass> mageec::mageec_ml::get_passes |
( |
) | |
|
Returns a set of passes the machine learner has chosen the compiler to execute.
- Returns
- list of passes to execute.
int mageec_ml::init |
( |
std::string |
dbfilename) | |
|
|
virtual |
Initilizes the MAGEEC Machine Learner.
- Parameters
-
dbfilename | Path of database file to open. |
- Returns
- 0 if MAGEEC successfully set up, 1 otherwise.
Reimplemented in mageec::file_ml.
Definition at line 34 of file ml.cpp.
int mageec_ml::init |
( |
std::string |
compiler_version, |
|
|
std::string |
compiler_target |
|
) |
| |
|
virtual |
Initilizes the MAGEEC Machine Learner.
- Parameters
-
compiler_version | Compiler and version, e.g. GCC-4.8. |
compiler_target | Compiler target, e.g. arm-none-gnueabi. |
- Returns
- 0 if MAGEEC successfully set up, 1 otherwise.
Reimplemented in mageec::file_ml.
Definition at line 44 of file ml.cpp.
Make a single function/pass decision based on provided feature vector.
- Parameters
-
pass | Pass to make a decision about. |
features | Feature vector of function to run pass on. |
- Returns
- decision
Reimplemented in mageec::file_ml.
Definition at line 96 of file ml.cpp.
void mageec_ml::new_file |
( |
void |
) | |
|
Prepares Machine Learner for a new file.
Definition at line 50 of file ml.cpp.
void mageec_ml::process_results |
( |
) | |
|
Informs the machine learner that it can process all new data to update internal decisions.
Definition at line 155 of file ml.cpp.
void mageec::mageec_ml::provide_features |
( |
std::vector< mageec_feature * > |
features) | |
|
Provide a set of program features to the machine learner to base decisions on.
- Parameters
-
features | List of features for program. |
void mageec::mageec_ml::raw_result |
( |
std::vector< mageec_feature * > |
features, |
|
|
std::vector< mageec_pass * > |
passes, |
|
|
std::vector< int64_t > |
metrics, |
|
|
bool |
good |
|
) |
| |
Adds a set of result points to machine learner raw database.
- Parameters
-
features | List of features for program. |
passes | List of passes executed during compilation. |
metrics | Performance metrics. |
good | Whether the result of compilation was valid (for machine learners that understand bad combinations.) |
The documentation for this class was generated from the following files: