mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Update readme.rst for pypi, change documentation style (#1663)
This commit is contained in:
parent
ac3d2ad897
commit
836d22cd4c
3 changed files with 6 additions and 93 deletions
|
|
@ -3,51 +3,10 @@ ONNX Runtime
|
||||||
|
|
||||||
ONNX Runtime
|
ONNX Runtime
|
||||||
enables high-performance evaluation of trained machine learning (ML)
|
enables high-performance evaluation of trained machine learning (ML)
|
||||||
models while keeping resource usage low.
|
models while keeping resource usage low once converted into ONNX format.
|
||||||
Building on Microsoft's dedication to the
|
See `project information <https://github.com/microsoft/onnxruntime>`_
|
||||||
`Open Neural Network Exchange (ONNX) <https://onnx.ai/>`_
|
and `Python API documentation and examples <https://aka.ms/onnxruntime-python>`_
|
||||||
community, it supports traditional ML models as well
|
for further details.
|
||||||
as Deep Learning algorithms in the
|
|
||||||
`ONNX-ML format <https://github.com/onnx/onnx/blob/master/docs/IR.md>`_.
|
|
||||||
Documentation is available at
|
|
||||||
`Python Bindings for ONNX Runtime <https://aka.ms/onnxruntime-python>`_.
|
|
||||||
|
|
||||||
Example
|
|
||||||
-------
|
|
||||||
|
|
||||||
The following example demonstrates an end-to-end example
|
|
||||||
in a very common scenario. A model is trained with *scikit-learn*
|
|
||||||
but it has to run very fast in a optimized environment.
|
|
||||||
The model is then converted into ONNX format and ONNX Runtime
|
|
||||||
replaces *scikit-learn* to compute the predictions.
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
# Train a model.
|
|
||||||
from sklearn.datasets import load_iris
|
|
||||||
from sklearn.model_selection import train_test_split
|
|
||||||
from sklearn.ensemble import RandomForestClassifier
|
|
||||||
iris = load_iris()
|
|
||||||
X, y = iris.data, iris.target
|
|
||||||
X_train, X_test, y_train, y_test = train_test_split(X, y)
|
|
||||||
clr = RandomForestClassifier()
|
|
||||||
clr.fit(X_train, y_train)
|
|
||||||
|
|
||||||
# Convert into ONNX format with onnxmltools
|
|
||||||
from skl2onnx import convert_sklearn
|
|
||||||
from skl2onnx.common.data_types import FloatTensorType
|
|
||||||
initial_type = [('float_input', FloatTensorType([1, 4]))]
|
|
||||||
onx = convert_sklearn(clr, initial_types=initial_type)
|
|
||||||
with open("rf_iris.onnx", "wb") as f:
|
|
||||||
f.write(onx.SerializeToString())
|
|
||||||
|
|
||||||
# Compute the prediction with ONNX Runtime
|
|
||||||
import onnxruntime as rt
|
|
||||||
import numpy
|
|
||||||
sess = rt.InferenceSession("rf_iris.onnx")
|
|
||||||
input_name = sess.get_inputs()[0].name
|
|
||||||
label_name = sess.get_outputs()[0].name
|
|
||||||
pred_onx = sess.run([label_name], {input_name: X_test.astype(numpy.float32)})[0]
|
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
-------
|
-------
|
||||||
|
|
@ -61,47 +20,3 @@ Release Notes : https://github.com/Microsoft/onnxruntime/releases/tag/v0.5.0
|
||||||
^^^^^
|
^^^^^
|
||||||
|
|
||||||
Release Notes : https://github.com/Microsoft/onnxruntime/releases/tag/v0.4.0
|
Release Notes : https://github.com/Microsoft/onnxruntime/releases/tag/v0.4.0
|
||||||
|
|
||||||
0.3.1
|
|
||||||
^^^^^
|
|
||||||
|
|
||||||
Protobuf-lite, NuGet file fixes (patch to 0.3.0).
|
|
||||||
|
|
||||||
0.3.0
|
|
||||||
^^^^^
|
|
||||||
|
|
||||||
C-API, Linux support for Dotnet Nuget package, Cuda 9.1 support.
|
|
||||||
|
|
||||||
0.2.1
|
|
||||||
^^^^^
|
|
||||||
|
|
||||||
C-API, Linux support for Dotnet Nuget package, Cuda 10.0 support (patch to 0.2.0).
|
|
||||||
|
|
||||||
0.2.0
|
|
||||||
^^^^^
|
|
||||||
|
|
||||||
C-API, Linux support for Dotnet Nuget package, Cuda 10.0 support
|
|
||||||
|
|
||||||
0.1.5
|
|
||||||
^^^^^
|
|
||||||
|
|
||||||
GA release as part of open sourcing onnxruntime (patch to 0.1.4).
|
|
||||||
|
|
||||||
0.1.4
|
|
||||||
^^^^^
|
|
||||||
|
|
||||||
GA release as part of open sourcing onnxruntime.
|
|
||||||
|
|
||||||
0.1.3
|
|
||||||
^^^^^
|
|
||||||
|
|
||||||
Fixes a crash on machines which do not support AVX instructions.
|
|
||||||
|
|
||||||
0.1.2
|
|
||||||
^^^^^
|
|
||||||
|
|
||||||
First release on Ubuntu 16.04 for CPU and GPU with Cuda 9.1 and Cudnn 7.0,
|
|
||||||
supports runtime for deep learning models architecture such as AlexNet, ResNet,
|
|
||||||
XCeption, VGG, Inception, DenseNet, standard linear learner,
|
|
||||||
standard ensemble learners,
|
|
||||||
and transform scaler, imputer.
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import onnxruntime
|
||||||
# markdown output: it requires two extensions available at:
|
# markdown output: it requires two extensions available at:
|
||||||
# https://github.com/xadupre/sphinx-docfx-yaml
|
# https://github.com/xadupre/sphinx-docfx-yaml
|
||||||
# https://github.com/xadupre/sphinx-docfx-markdown
|
# https://github.com/xadupre/sphinx-docfx-markdown
|
||||||
import sphinx_modern_theme
|
|
||||||
import recommonmark
|
import recommonmark
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
|
|
@ -67,8 +66,7 @@ pygments_style = 'sphinx'
|
||||||
|
|
||||||
# -- Options for HTML output -------------------------------------------------
|
# -- Options for HTML output -------------------------------------------------
|
||||||
|
|
||||||
html_theme = "sphinx_modern_theme"
|
html_theme = "pyramid"
|
||||||
html_theme_path = [sphinx_modern_theme.get_html_theme_path()]
|
|
||||||
html_logo = "../ONNX_Runtime_icon.png"
|
html_logo = "../ONNX_Runtime_icon.png"
|
||||||
html_static_path = ['_static']
|
html_static_path = ['_static']
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
sphinx
|
sphinx
|
||||||
sphinx_gallery
|
sphinx_gallery
|
||||||
sphinx_modern_theme
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue