v2.0.0
Loading...
Searching...
No Matches
ml_model.h File Reference

Pure-virtual MLLIB::MlModel interface that every MLLIB inference backend implements. More...

#include "ml_global.h"
#include "ml_types.h"
#include "ml_tensor.h"
#include <QSharedPointer>
#include <QString>
Include dependency graph for ml_model.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MLLIB::MlModel
 Backend-agnostic inference interface: load, predict, save plus model/task descriptors. More...

Namespaces

namespace  MLLIB
 Tensors, model abstraction, ONNX Runtime inference and Python training drivers used across mne-cpp.

Detailed Description

Pure-virtual MLLIB::MlModel interface that every MLLIB inference backend implements.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.2.0
Date
April 2026

MLLIB::MlModel is the polymorphic seam between mne-cpp application code and the underlying runtime that actually executes a graph (ONNX Runtime today, potentially LibTorch or a native kernel tomorrow). The interface intentionally exposes only four operations

  • predict, save, load and the modelType / taskType descriptors - so any backend can be slotted in without leaking runtime-specific types into the public API.

Inputs and outputs flow through MLLIB::MlTensor, the shared N-dimensional float32 carrier, which gives ONNX Runtime a zero-copy path into its own tensor representation while keeping Eigen-based pre/post-processing in mne-cpp idiomatic. Implementations are expected to be cheap to copy-by-shared-pointer (see SPtr) so models can be parked on UI threads and invoked from worker threads without ownership questions.

Definition in file ml_model.h.