Package com.helix.core.ml
Class OnnxModelExecutor
java.lang.Object
com.helix.core.ml.OnnxModelExecutor
Static runtime bridge for executing ONNX model inference from compiled JVM bytecode and interpreters.
Provides high-performance static dispatch methods invoked directly by compiled rule classes
via INVOKESTATIC, delegating to the globally active OnnxSessionPool.
-
Method Summary
Modifier and TypeMethodDescriptionstatic doubleevaluate(String modelName, ExecutionContext context) Evaluates the named model using its default output tensor and class index.static doubleevaluate(String modelName, String outputTensorName, int outputIndex, ExecutionContext context) Evaluates the named model with custom output tensor and index mapping.static OnnxInferenceResultevaluateWithResult(String modelName, ExecutionContext context) Evaluates the named model and returns the full telemetryOnnxInferenceResult.static OnnxSessionPoolRetrieves the active session pool.static voidreset()Resets the active session pool reference.static voidRegisters the active session pool for runtime evaluation.
-
Method Details
-
setSessionPool
Registers the active session pool for runtime evaluation.- Parameters:
pool- session pool instance
-
getSessionPool
Retrieves the active session pool.- Returns:
- current active session pool, or null if uninitialized
-
reset
public static void reset()Resets the active session pool reference. -
evaluate
Evaluates the named model using its default output tensor and class index.- Parameters:
modelName- model identifiercontext- runtime execution context- Returns:
- probability or score value as a double
-
evaluate
public static double evaluate(String modelName, String outputTensorName, int outputIndex, ExecutionContext context) Evaluates the named model with custom output tensor and index mapping.- Parameters:
modelName- model identifieroutputTensorName- target output tensor nameoutputIndex- target class or output indexcontext- runtime execution context- Returns:
- extracted score value as a double
-
evaluateWithResult
Evaluates the named model and returns the full telemetryOnnxInferenceResult.- Parameters:
modelName- model identifiercontext- runtime execution context- Returns:
- detailed inference result
-