Skip to main content

An easy and interactive graph visualization tool for ML models!!!

Project description

model_vis

Dynamic Visualization tool for machine learning models that displays the models

For Users

Graph Visualization Usage Documentation

Usage

pip install model-vis

python -m graph_visualization.plot_graph
--pb_graph_path=path_to_protobuf/protobuf.pb

Required Parameter: -- pb_graph_path (str , path to the protobuf file on the system)

[NOTE : ONLY PASS PROTOBUFS THAT ARE CONVERTED FROM TF ]

Optional Parameters :

-- port (int, default port is 5000).

-- pb_graph_type (str , currently only supports "tf" and is default. Other types like .onnx to be supported in future)

Interpreting Graph

A graph is created from the protobuf file passed as a parameter and is served on the given port_no .

The nodes are interactive and can be moved around as per convenience.

Edges show name , port, dtype and shape on hover.

Nodes show node types by default and hovering over nodes shows node name and ohter attribute info.

All the information in the graph is contained in graph.json file which can be accessed by going to the URL: localhost/:port_no/graph.json

Features

Search

The search bar below the graph window provides a functionality to search for a particular node. The auto suggest drop down appears as you type to help you find the node quicker.
The search is activated after the 'Highlight Node' button is clicked. As the node is found, the window auto pans to the particular node being in the centre and it starts a pulse animation to disambiguate the searched node from the cluster.
Use the 'Shrink Node' button to stop the animation.

Find Neighbors

Double click on any node to highlight it's neighboring nodes and respective edges.

Control bar

The control bar is present on the top right corner of the page. It can be minimized by clicking the close controls button at the bottom of the control bar. Once the graph becomes static (which is after interacting with a particular node/edge) "Link Distance" , "Link Strength" and "Node Strength" features become unavaialable.

The following configurations can be changed from the control bar which makes live changes to the graph.

Link Distance

It specifies how far apart should 2 nodes be from each other.
The value ranges from 0 to 400. It is better to have a higher value for huge complex graphs.

Link Strength

It specifies how strongly the link pulls the other nodes. The value ranges from 0 (repulsion) to 1 (pull).

Node Strength

Works similar to Link Strength.
It specifies how strongly nodes pull each other. The value ranges from -500 (low pull value therefore higher repel) to -1 (Maximum pull).

Lazy Load

Only the nodes whose current positions lie in the viewing window are loaded, other node information is known (present in the .json file) but no additional overhead is caused as none of these node or link related elements are shown.

While zooming out , if the zoom out reaches a value where the current window holds more than 500 nodes, the nodes are hidden but the links are visible. This is done to reduce the load.

Conversely, upon zooming in, if the viewing window has < 500 nodes, all the respective node and link elements are shown.

Show / Hide Node Labels

A functionality to turn off the node labelling.

Color Nodes By

A filter to visualize the nodes based on

  1. Error Values
  2. None (Same color to all nodes)
Restart

Restarts the given graph by reloading.

Libraries Used

The graph visualization is based on Node JS and the visualization library D3.

For Developers/ Contributors

Requirements

1. Clone the repo from github

2. Conda (using Miniconda)

Setup Miniconda

Install Miniconda3 using these instructions

Create the virtual environment and activate it

model_vis$ conda env create -f environment.yml
model_vis$ conda activate vis-env
(vis-env) model_vis $

3. Bazel

Bazel can be installed with Bazelisk , it downloads the appropriate bazel version for the current working directory.

Create symbolic link to use bazelisk whenever "bazel" is called

ln -s $(which bazelisk) bazel

Running the file (thorugh bazel)

bazel run //graph_visualization:plot_graph
-- --pb_graph_path=abs_path_to_protobuf/protobuf.pb
--port=port_no

Required Parameters: -- pb_graph_path (str , path to the protobuf file on the system)

[NOTE : ONLY PASS PROTOBUFS THAT ARE CONVERTED FROM TF ]

Optional Parameters :

-- port (int, default port is 5000).

-- pb_graph_type (str , currently only supports "tf" and is default. Other types like .onnx to be supported in future)

Click the link provided by the terminal to open into visualization in browser

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

model_vis-0.0.22.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

model_vis-0.0.22-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file model_vis-0.0.22.tar.gz.

File metadata

  • Download URL: model_vis-0.0.22.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.11

File hashes

Hashes for model_vis-0.0.22.tar.gz
Algorithm Hash digest
SHA256 25dbd2f7eea49f5d9b72667d70fdcca442ee33059b0fe55900d06a7bc70a847e
MD5 cf63b1fbe2a940f760b1883730ba11af
BLAKE2b-256 fa341a7e1a607f5b2f063bf5c7fccba44a94b47e6f2c743d1a36ff1bc59a0c2c

See more details on using hashes here.

File details

Details for the file model_vis-0.0.22-py3-none-any.whl.

File metadata

  • Download URL: model_vis-0.0.22-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.11

File hashes

Hashes for model_vis-0.0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 05c4631fb5b8ddaa6377d759896e7b9310feecb2458681d7a47d17adae4f7505
MD5 125525c80fce1b7d688c6650775f1d7f
BLAKE2b-256 1453df4744c970f8e0d85215c53c04865d882d1b8a4ae9923ae59f7180f66805

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page