module external.onnxruntime_perf
¶
Short summary¶
module pymlbenchmark.external.onnxruntime_perf
Implements a benchmark about performance for onnxruntime
Classes¶
class |
truncated documentation |
---|---|
Specific test to compare computing time predictions with scikit-learn and onnxruntime. See example … |
Methods¶
method |
truncated documentation |
---|---|
Returns a random datasets. |
|
Finalizes the init. |
|
Generates random features. |
|
Populates member |
|
Populates member |
|
Returns additional informations about a model. |
|
Checks that methods predict and predict_proba returns the same results for both scikit-learn and … |
Documentation¶
Implements a benchmark about performance for onnxruntime
- class pymlbenchmark.external.onnxruntime_perf.OnnxRuntimeBenchPerfTest(estimator, dim=None, N_fit=100000, runtimes=('python_compiled', 'onnxruntime1'), onnx_options=None, dtype=<class 'numpy.float32'>, **opts)¶
Bases:
BenchPerfTest
Specific test to compare computing time predictions with scikit-learn and onnxruntime. See example Benchmark of onnxruntime on LogisticRegression. The class requires the following modules to be installed: onnx, onnxruntime, skl2onnx, mlprodict.
- Parameters:
estimator – estimator class
dim – number of features
N_fit – number of observations to fit an estimator
runtimes – runtimes to test for class OnnxInference
opts – training settings
onnx_options – ONNX conversion options
dtype – dtype (float32 or float64)
- __init__(estimator, dim=None, N_fit=100000, runtimes=('python_compiled', 'onnxruntime1'), onnx_options=None, dtype=<class 'numpy.float32'>, **opts)¶
- Parameters:
estimator – estimator class
dim – number of features
N_fit – number of observations to fit an estimator
runtimes – runtimes to test for class OnnxInference
opts – training settings
onnx_options – ONNX conversion options
dtype – dtype (float32 or float64)
- _get_random_dataset(N, dim)¶
Returns a random datasets.
- _init(onx, runtimes)¶
Finalizes the init.
- data(N=None, dim=None, **kwargs)¶
Generates random features.
- Parameters:
N – number of observations
dim – number of features
- extract_model_info_onnx(**kwargs)¶
Populates member
self.onnx_info
with additional information on the ONNX graph.
- extract_model_info_skl(**kwargs)¶
Populates member
self.skl_info
with additional information on the model such as the number of node for a decision tree.
- model_info(model)¶
Returns additional informations about a model.
- Parameters:
model – model to describe
- Returns:
dictionary with additional descriptor
- validate(results, **kwargs)¶
Checks that methods predict and predict_proba returns the same results for both scikit-learn and onnxruntime.