Skip to main content

A simple and easy to use tool to visualize Neural Networks.

Project description

Neural Network Visualizer (NNV)

Simple and easy to use tool to generate Neural Network Visualizations.

Installation

pip install nnv

Usage

from nnv import NNV

layersList = [
    {"title":"input\n(relu)", "units": 3, "color": "darkBlue"},
    {"title":"hidden 1\n(relu)", "units": 3},
    {"title":"output\n(sigmoid)", "units": 1,"color": "darkBlue"},
]

NNV(layersList).render()

It is possible to customize the node size/colors, title font size, spacing between nodes and layers and maximum number of nodes to show,...

from nnv import NNV
layersList = [
    {"title":"input\n(relu)", "units": 300, "color": "darkBlue"},
    {"title":"hidden 1\n(relu)", "units": 150},
    {"title":"hidden 2\n(relu)",  "units": 75},
    {"title":"Dropout\n(0.5)", "units": 75, "color": "lightGray"},
    {"title":"hidden 4\n(relu)",  "units": 18},
    {"title":"hidden 5\n(relu)",  "units": 9},
    {"title":"hidden 6\n(relu)",  "units": 4},
    {"title":"output\n(sigmoid)", "units": 1,"color": "darkBlue"},
]

nnv.NNV(layersList, max_num_nodes_visible=10, spacing_layer=120, spacing_nodes=2, font_size=20).render(save_to_file="my_pdf_output_example.pdf", do_not_show=True)

Documentation

NNV documentation is still being created. For now, if you have any question, please look directly the library source code or open an Issue.

Future addittions

Some useful features that may be added in the future (help is welcome):

  • add labels to each node
  • import layers info directly from a keras model

Credits / Citation

You are not required, but if you use this library, you can cite it:

 R. Cordeiro, "NNV: Neural Network Vizualizer", 2019. [Online]. Available: https://github.com/renatosc/nnv. [Accessed: DD- Month- 20YY].

or using:

@Misc{,
  author = {Renato Cordeiro},
  title  = {NNV: Neural Network Vizualizer},
  month  = may,
  year   = {2019},
  note   = {Online; accessed <today>},
  url    = {https://github.com/renatosc/nnv},
}

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

nnv-0.0.2.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

nnv-0.0.2-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

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