ONNX visualization

ONNX is a serialization format for machine learned model. It is a list of mathematical functions used to describe every prediction function for standard and deep machine learning. Module onnx offers some tools to display ONNX graph. Netron is another approach. The following notebooks explore a ligher visualization.

Train a model

Convert a model

Explore it with OnnxInference

dot

magic commands

The module implements a magic command to easily display graphs.

Shape information

It is possible to use the python runtime to get an estimation of each node shape.

The shape (n, 2) means a matrix with an indefinite number of rows and 2 columns.

runtime

Let's compute the prediction using a Python runtime.

Which we compare to the original model.

Some time measurement...

With one observation:

Add metadata

It is possible to add metadata once the model is converted.

Simple PCA

The graph would probably be faster if the multiplication was done before the subtraction because it is easier to do this one inline than the multiplication.