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//=============================================================================================================
58{
59public:
60 typedef QSharedPointer<MlModel> SPtr;
61
62 //=========================================================================================================
66 virtual ~MlModel() = default;
67
68 //=========================================================================================================
75 virtual MlTensor predict(const MlTensor& input) const = 0;
76
77 //=========================================================================================================
84 virtual bool save(const QString& path) const = 0;
85
86 //=========================================================================================================
93 virtual bool load(const QString& path) = 0;
94
95 //=========================================================================================================
99 virtual QString modelType() const = 0;
100
101 //=========================================================================================================
105 virtual MlTaskType taskType() const = 0;
106};
107
108} // namespace MLLIB
109
110#endif // ML_MODEL_H
Strongly typed enumerations describing the ML backend, tensor element type and inference task.
N-dimensional, row-major, reference-counted float32 tensor used as the universal MLLIB data carrier.
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:51
Backend-agnostic inference interface: load, predict, save plus model/task descriptors.
Definition ml_model.h:58
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:60
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:73