v2.0.0
Loading...
Searching...
No Matches
MLLIB::MlModel Class Referenceabstract

Abstract interface for all ML models. More...

#include <ml_model.h>

Public Types

typedef QSharedPointer< MlModelSPtr

Public Member Functions

virtual ~MlModel ()=default
virtual MlTensor predict (const MlTensor &input) const =0
virtual bool save (const QString &path) const =0
virtual bool load (const QString &path)=0
virtual QString modelType () const =0
virtual MlTaskType taskType () const =0

Detailed Description

Abstract interface for all ML models.

Definition at line 63 of file ml_model.h.

Inheritance diagram for MLLIB::MlModel:
Inheritance graph

Member Typedef Documentation

◆ SPtr

typedef QSharedPointer<MlModel> MLLIB::MlModel::SPtr

Shared pointer type for MlModel.

Definition at line 66 of file ml_model.h.

Constructor & Destructor Documentation

◆ ~MlModel()

virtual MLLIB::MlModel::~MlModel ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ load()

virtual bool MLLIB::MlModel::load ( const QString & path)
pure virtual

Load a model from disk.

Parameters
[in]pathFile path.
Returns
True if successful.

Implemented in MLLIB::MlLinearModel, and MLLIB::MlOnnxModel.

◆ modelType()

virtual QString MLLIB::MlModel::modelType ( ) const
pure virtual
Returns
Human-readable model type name.

Implemented in MLLIB::MlLinearModel, and MLLIB::MlOnnxModel.

◆ predict()

virtual MlTensor MLLIB::MlModel::predict ( const MlTensor & input) const
pure virtual

Run inference on the given input tensor.

Parameters
[in]inputThe input data.
Returns
The prediction result.

Implemented in MLLIB::MlLinearModel, and MLLIB::MlOnnxModel.

◆ save()

virtual bool MLLIB::MlModel::save ( const QString & path) const
pure virtual

Serialise the model to disk.

Parameters
[in]pathFile path.
Returns
True if successful.

Implemented in MLLIB::MlLinearModel, and MLLIB::MlOnnxModel.

◆ taskType()

virtual MlTaskType MLLIB::MlModel::taskType ( ) const
pure virtual
Returns
The task type this model is configured for.

Implemented in MLLIB::MlLinearModel, and MLLIB::MlOnnxModel.


The documentation for this class was generated from the following file: