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
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
model_file
the location of the asset containing a predictor model file
features_file
the location of the asset containing the feature list matching the model
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
data
the memory data from the device.
Returns
the result from the model.

~IPredictor

virtual  ~IPredictor()

Protected functions

GetFromPath

float GetFromPath(
  std::string feature,
  Json::object data
)