v2.0.0
Loading...
Searching...
No Matches
ml_model.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef ML_MODEL_H
36#define ML_MODEL_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
42#include "ml_global.h"
43#include "ml_types.h"
44#include "ml_tensor.h"
45
46//=============================================================================================================
47// QT INCLUDES
48//=============================================================================================================
49
50#include <QSharedPointer>
51#include <QString>
52
53//=============================================================================================================
54// DEFINE NAMESPACE MLLIB
55//=============================================================================================================
56
57namespace MLLIB{
58
59//=============================================================================================================
64{
65public:
66 typedef QSharedPointer<MlModel> SPtr;
67
68 //=========================================================================================================
72 virtual ~MlModel() = default;
73
74 //=========================================================================================================
81 virtual MlTensor predict(const MlTensor& input) const = 0;
82
83 //=========================================================================================================
90 virtual bool save(const QString& path) const = 0;
91
92 //=========================================================================================================
99 virtual bool load(const QString& path) = 0;
100
101 //=========================================================================================================
105 virtual QString modelType() const = 0;
106
107 //=========================================================================================================
111 virtual MlTaskType taskType() const = 0;
112};
113
114} // namespace MLLIB
115
116#endif // ML_MODEL_H
ML type enumerations.
ml library export/import macros.
#define MLSHARED_EXPORT
Definition ml_global.h:55
MlTensor class declaration — N-dimensional, row-major, zero-copy.
Machine learning (models, pipelines, ONNX Runtime integration).
MlTaskType
Definition ml_types.h:60
Abstract interface for all ML models.
Definition ml_model.h:64
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:66
virtual bool save(const QString &path) const =0
virtual ~MlModel()=default
N-dimensional tensor with contiguous row-major (C-order) float32 storage.
Definition ml_tensor.h:79