memory_advice:: IPredictor
This is an abstract class.#include <predictor.h>A class to help predict memory limits using tensorflow lite models.
Summary
Inheritance
Direct Known Subclasses:memory_advice::DefaultPredictor
Constructors and Destructors |
|
|---|---|
~IPredictor()
|
Public functions |
|
|---|---|
Init(std::string model_file, std::string features_file)=0
|
virtual MemoryAdvice_ErrorCode
Initializes the predictor with the given model.
|
Predict(Json::object data)=0
|
virtual float
Runs the tensorflow model with the provided data.
|
Protected functions |
|
|---|---|
GetFromPath(std::string feature, Json::object data)
|
float
|
Public functions
Init
virtual MemoryAdvice_ErrorCode Init( std::string model_file, std::string features_file )=0
Initializes the predictor with the given model.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Returns |
MEMORYADVICE_ERROR_TFLITE_MODEL_INVALID if the provided model was invalid, or MEMORYADVICE_ERROR_OK if there are no errors.
|
Predict
virtual float Predict( Json::object data )=0
Runs the tensorflow model with the provided data.
| Details | |||
|---|---|---|---|
| Parameters |
|
||
| Returns |
the result from the model.
|
~IPredictor
virtual ~IPredictor()
Protected functions
GetFromPath
float GetFromPath( std::string feature, Json::object data )