Stay organized with collections
Save and categorize content based on your preferences.
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
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
)
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2023-11-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-27 UTC."],[],[],null,["# memory_advice::IPredictor Class Reference\n\nmemory_advice::IPredictor\n=========================\n\n**This is an abstract class.** \n\n`#include \u003cpredictor.h\u003e`\n\nA class to help predict memory limits using tensorflow lite models.\n\nSummary\n-------\n\n### Inheritance\n\nDirect Known Subclasses:[memory_advice::DefaultPredictor](/reference/games/memory-advice/classmemory/advice-1-1-default-predictor)\n\n| ### Constructors and Destructors ||\n|---|---|\n| [~IPredictor](#classmemory__advice_1_1_i_predictor_1a7da88bb44a0de0d98529b36ec35a46fc)`()` ||\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Init](#classmemory__advice_1_1_i_predictor_1a987ff04e3399141caf372022911dd928)`(std::string model_file, std::string features_file)=0` | `virtual `[MemoryAdvice_ErrorCode](/reference/games/memory-advice/group/memory-advice#group__memory__advice_1ga7061497339a50e977d400a58b8fb9f82) Initializes the predictor with the given model. |\n| [Predict](#classmemory__advice_1_1_i_predictor_1ae0c8896d3a5a971ae240159ef0f76e61)`(Json::object data)=0` | `virtual float` Runs the tensorflow model with the provided data. |\n\n| ### Protected functions ||\n|----------------------------------------------------------------------------------------------------------------------------------|---------|\n| [GetFromPath](#classmemory__advice_1_1_i_predictor_1ad7543efaf3747f970db8b4fc676bd05b)`(std::string feature, Json::object data)` | `float` |\n\nPublic functions\n----------------\n\n### Init\n\n```scdoc\nvirtual MemoryAdvice_ErrorCode Init(\n std::string model_file,\n std::string features_file\n)=0\n``` \nInitializes the predictor with the given model.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 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 | |\n| **Returns** | MEMORYADVICE_ERROR_TFLITE_MODEL_INVALID if the provided model was invalid, or MEMORYADVICE_ERROR_OK if there are no errors. |\n\n### Predict\n\n```text\nvirtual float Predict(\n Json::object data\n)=0\n``` \nRuns the tensorflow model with the provided data.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|---------------------------------------------------------------------------------------------|\n| Parameters | |--------|----------------------------------| | `data` | the memory data from the device. | |\n| **Returns** | the result from the model. |\n\n### \\~IPredictor\n\n```text\nvirtual ~IPredictor()\n``` \n\nProtected functions\n-------------------\n\n### GetFromPath\n\n```text\nfloat GetFromPath(\n std::string feature,\n Json::object data\n)\n```"]]