v2.0.0
Loading...
Searching...
No Matches
ml_model.h
Go to the documentation of this file.
1//=============================================================================================================
28
29#ifndef ML_MODEL_H
30#define ML_MODEL_H
31
32//=============================================================================================================
33// INCLUDES
34//=============================================================================================================
35
36#include "ml_global.h"
37#include "ml_types.h"
38#include "ml_tensor.h"
39
40//=============================================================================================================
41// QT INCLUDES
42//=============================================================================================================
43
44#include <QSharedPointer>
45#include <QString>
46
47//=============================================================================================================
48// DEFINE NAMESPACE MLLIB
49//=============================================================================================================
50
51namespace MLLIB
52{
53
54//=============================================================================================================
61{
62public:
63 typedef QSharedPointer<MlModel> SPtr;
64
65 //=========================================================================================================
69 virtual ~MlModel() = default;
70
71 //=========================================================================================================
78 virtual MlTensor predict(const MlTensor& input) const = 0;
79
80 //=========================================================================================================
87 virtual bool save(const QString& path) const = 0;
88
89 //=========================================================================================================
96 virtual bool load(const QString& path) = 0;
97
98 //=========================================================================================================
102 virtual QString modelType() const = 0;
103
104 //=========================================================================================================
108 virtual MlTaskType taskType() const = 0;
109};
110
111} // namespace MLLIB
112
113#endif // ML_MODEL_H
N-dimensional, row-major, reference-counted float32 tensor used as the universal MLLIB data carrier.
Strongly typed enumerations describing the ML backend, tensor element type and inference task.
Export/import macros, build-stamp accessors and namespace anchor for the MLLIB machine-learning libra...
#define MLSHARED_EXPORT
Definition ml_global.h:48
Tensors, model abstraction, ONNX Runtime inference and Python training drivers used across mne-cpp.
MlTaskType
Definition ml_types.h:62
Backend-agnostic inference interface: load, predict, save plus model/task descriptors.
Definition ml_model.h:61
virtual MlTensor predict(const MlTensor &input) const =0
virtual MlTaskType taskType() const =0
virtual bool load(const QString &path)=0
virtual QString modelType() const =0
QSharedPointer< MlModel > SPtr
Definition ml_model.h:63
virtual bool save(const QString &path) const =0
virtual ~MlModel()=default
N-dimensional row-major float32 tensor with shared-buffer storage, Eigen Map accessors and a non-owni...
Definition ml_tensor.h:76