.. _f-graphs: module ``tools.graphs`` ======================= .. inheritance-diagram:: mlprodict.tools.graphs Short summary +++++++++++++ module ``mlprodict.tools.graphs`` Alternative to dot to display a graph. Classes +++++++ +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | class | truncated documentation | +===============================================================================+==================================================================================================+ | :class:`AdjacencyGraphDisplay ` | Structure which contains the necessary information to display a graph using an adjacency matrix. | +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :class:`BiGraph ` | BiGraph representation. | +-------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ Functions +++++++++ +--------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | function | truncated documentation | +==========================================================================+========================================================================================================================+ | :func:`make_hash_bytes ` | Creates a hash of length *length*. | +--------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :func:`onnx2bigraph ` | Converts an ONNX graph into a graph representation, edges, vertices. | +--------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :func:`onnx_graph_distance ` | Computes a distance between two ONNX graphs. They must not be too big otherwise this function might take for ever. ... | +--------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ Static Methods ++++++++++++++ +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | staticmethod | truncated documentation | +===============================================================================================+========================================================================================================================+ | :py:meth:`_onnx2bigraph_basic ` | Implements graph type `'basic'` for function :func:`onnx2bigraph`. | +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_onnx2bigraph_simplified ` | Implements graph type `'simplified'` for function :func:`onnx2bigraph`. | +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :meth:`onnx_graph_distance ` | Computes a distance between two ONNX graphs. They must not be too big otherwise this function might take for ever. ... | +-----------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ Methods +++++++ +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | method | truncated documentation | +==============================================================================+===================================================================================================+ | :py:meth:`__getitem__ ` | Returns a vertex is key is a string or an edge if it is a tuple. | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | :py:meth:`__iter__ ` | Iterates over actions. | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | :py:meth:`__iter__ ` | Iterates over all vertices and edges. It produces 3-uples: | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | :py:meth:`__str__ ` | usual | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | :py:meth:`__str__ ` | usual | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | :meth:`add ` | Adds an action to display the graph. | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | :meth:`adjacency_matrix ` | Builds an adjacency matrix. | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | :meth:`display_structure ` | Creates a display structure which contains all the necessary steps to display a graph. | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | :meth:`order ` | Order nodes. Depth first. Returns a sequence of keys of mixed *v1*, *v2*. | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | :meth:`order_vertices ` | Orders the vertices from the input to the output. | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | :meth:`summarize ` | Creates a text summary of the graph. | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | :meth:`to_text ` | Displays the graph as a single string. See :func:`onnx2bigraph` to see how the result looks like. | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: mlprodict.tools.graphs :members: :special-members: __init__ :show-inheritance: