MlOnnxModel
Namespace: MLLIB · Library: Machine Learning Library
#include <ml/ml_onnx_model.h>
class MLLIB::MlOnnxModel
MlModel backend that runs ``.onnx graphs through ONNX Runtime with a cached CPU session.
When mne-cpp is configured without USE_ONNXRUNTIME every method either throws std::runtime_error (predict) or returns false / logs a warning (load, save), so the same client code compiles and links on minimal builds and on WebAssembly without conditional call sites.
Inheritance
Public Methods
MlOnnxModel()
Default constructor.
~MlOnnxModel()
Destructor.
predict(input)
Run inference on the given input tensor.
Parameters:
- input : const MlTensor & The input data.
Returns:
- MlTensor — The prediction result.
save(path)
Serialise the model to disk.
Parameters:
- path : const QString & File path.
Returns:
- bool — True if successful.
load(path)
Load a model from disk.
Parameters:
- path : const QString & File path.
Returns:
- bool — True if successful.
modelType()
Returns:
- QString — Human-readable model type name.
taskType()
Returns:
- MlTaskType — The task type this model is configured for.
isLoaded()
Returns:
- bool — True if an ONNX Runtime session has been loaded and is ready for inference.
Authors of this file
- Christoph Dinh <christoph.dinh@mne-cpp.org>