Files
SpotMicroESP32-Leika/esp32/lib/ESP32-sveltekit/NeuralNetwork.h
T
Rune Harlyk ef4e476b89 📦 Moves NN
2024-08-18 17:06:05 +02:00

38 lines
784 B
C++

#ifndef __NeuralNetwork__
#define __NeuralNetwork__
#include "model.h"
#include <stdint.h>
namespace tflite {
template <unsigned int tOpCount>
class MicroMutableOpResolver;
class ErrorReporter;
class Model;
class MicroInterpreter;
} // namespace tflite
struct TfLiteTensor;
class NeuralNetwork {
private:
tflite::MicroMutableOpResolver<10> *resolver;
tflite::ErrorReporter *error_reporter;
tflite::MicroInterpreter *interpreter;
const tflite::Model *model;
uint8_t *tensor_arena;
TfLiteTensor *input;
TfLiteTensor *output;
const int _kArenaSize = 20000;
void setInput(float value);
float predict();
public:
NeuralNetwork(const void *model_data = g_model, const int kArenaSize = 20000);
float predict(float value);
};
#endif