:orphan: |rss_image| **onnx - 1/1** :ref:`Blog ` :ref:`benchmark (4) ` :ref:`onnx (8) ` .. |rss_image| image:: feed-icon-16x16.png :target: ../_downloads/rss.xml :alt: RSS ---- .. index:: onnx .. _ap-cat-onnx-0: onnx - 1/1 ++++++++++ .. blogpostagg:: :title: Xop, easy to create onnx graph :date: 2022-02-27 :keywords: tips,tensorflow,tensorflow-onnx :categories: xop,onnx :rawfile: 2022/2022-02-27_xop.rst :epkg:`onnx` package has a very verbose API to create ONNX graph. Could you imagine a user to directly write the syntax tree of a program instead of some python code? Creating a ONNX graph is very similar to that task except ONNX language is more simple than python. ... .. blogpostagg:: :title: Decompose einsum into numpy operators :date: 2021-08-11 :keywords: einsum :categories: onnx :rawfile: 2021/2021-08-11_einsum.rst Notebook :ref:`einsumdecompositionrst` what function :epkg:`numpy:einsum` does and how it can be decomposed into a series of basic operations, all available in ONNX. That's the purpose of function Function :func:`decompose_einsum_equation `. With function :func:`export2numpy `, it is possible to convert back this ONNX graph into a series of numpy operations. ... .. blogpostagg:: :title: onnxruntime shape [] != None :date: 2021-08-10 :keywords: onnxruntime :categories: onnx :rawfile: 2021/2021-08-10_shape.rst `None` is the undefined shape, `[]` is an empty shape. And when shapes do not fit the results, the outputs can be suprising. The following example shows what :epkg:`onnxruntime` produces for the same graph except input and output shapes when defined as `None` and `[]`. ... .. blogpostagg:: :title: Operator CDist :date: 2019-09-16 :keywords: onnxruntime,cdist :categories: onnx :rawfile: 2019/2019-09-16_cdist.rst Notebooks :ref:`onnxpdistrst` shows how much slower an :epkg:`ONNX` implementation of function :epkg:`cdist`, from 3 to 10 times slower. One way to optimize the converted model is to create dedicated operator such as one for function :epkg:`cdist`. Tutorial :ref:`l-onnx-tutorial-optim` explains how to tell function :func:`to_onnx ` to use the custom operator `CDist`. .. blogpostagg:: :title: Float, double with ONNX :date: 2019-08-23 :keywords: onnx,float,double :categories: onnx :rawfile: 2019/2019-08-23_onnx_float_double.rst Replicating what a library does, :epkg:`scikit-learn` for example, is different from implementing a function defined in a paper. Every trick needs to be replicated. :epkg:`scikit-learn` trees implement a prediction function which takes float features and compares them to double thresholds. Knowning the :epkg:`ONNX` assumes that comparison only happens numbers of the same type, you end up with discrepencies. ... .. blogpostagg:: :title: ONNX updates :date: 2019-08-02 :keywords: onnx,onnxrt,update :categories: onnx :rawfile: 2019/2019-08-02_onnx_changes.rst The python runtime is now almost complete for all the supported numerical operator implemented in :epkg:`sklearn-onnx`. A couple of notebooks introduces a couple of way to investigates issues, to benchmark ONNX models with :epkg:`onnxruntime` or python runtime, to check the differences between the same model. It also extend ONNX with operators not in the specification to experiment some assumptions and check it is more efficient. Notebook :ref:`onnxshakerrst` introduces a way to guess the margins introduced by the conversion from double to single. There also exists a function to convert numpy function into ONNX (see :ref:`l-numpy2onnx-tutorial`). Its coverage is probably low but it will improve. .. blogpostagg:: :title: ONNX, runtime :date: 2019-06-25 :keywords: onnx,onnxrt :categories: onnx :rawfile: 2019/2019-06-25_runtime.rst Somebody asked me one day if it would be difficult to write a runtime for :epkg:`ONNX` in :epkg:`Rust`. I just replied that it should not take that long but it would require to implement a way to goes through the nodes of the :epkg:`ONNX` graph and to have an implementation for every :epkg:`ONNX Operators`... ... .. blogpostagg:: :title: ONNX, runtime, converters :date: 2019-06-15 :keywords: onnx,onnxrt :categories: onnx :rawfile: 2019/2019-06-15_onnxrt.rst I have been recently working on :epkg:`sklearn-onnx` to write converter from :epkg:`scikit-learn` operators to :epkg:`ONNX` serialization format. I was talking about that a month ago and somebody asked me if there was a runtime implemented in `RUST `_. Not that I know of but I said it would not be too complex to implement one. ... ---- |rss_image| **onnx - 1/1** :ref:`2021-08 (3) ` :ref:`2022-02 (1) ` :ref:`2022-05 (1) ` :ref:`2022-06 (1) ` :ref:`2022-11 (1) `