Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/renatosc/nnv
NNV - Neural Network Visualizer
https://github.com/renatosc/nnv
jupyter-notebook keras neural-network-visualizations pip python tensorflow
Last synced: 2 months ago
JSON representation
NNV - Neural Network Visualizer
- Host: GitHub
- URL: https://github.com/renatosc/nnv
- Owner: renatosc
- License: mit
- Created: 2019-05-21T03:59:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-05T23:02:11.000Z (over 3 years ago)
- Last Synced: 2024-10-01T16:08:17.766Z (3 months ago)
- Topics: jupyter-notebook, keras, neural-network-visualizations, pip, python, tensorflow
- Language: Python
- Homepage:
- Size: 1.93 MB
- Stars: 20
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Neural Network Visualizer (NNV)
Simple and easy to use tool to generate Neural Network Visualizations.
# Installation
```
pip install nnv
```# Usage
```python
from nnv import NNVlayersList = [
{"title":"input\n(relu)", "units": 3, "color": "darkBlue"},
{"title":"hidden 1\n(relu)", "units": 3},
{"title":"hidden 2\n(relu)", "units": 3, "edges_color":"red", "edges_width":2},
{"title":"output\n(sigmoid)", "units": 1,"color": "darkBlue"},
]NNV(layersList).render()
```![alt text](./examples/my_example_1.png "Example")
It is possible to customize the node size/colors, title font size, spacing between nodes and layers and maximum number of nodes to show,...
```python
from nnv import NNV# Let's increase the size of the plot
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (200,10)layers_list = [
{"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(layers_list, max_num_nodes_visible=8, node_radius=10, spacing_layer=60, font_size=24).render(save_to_file="my_example_2.pdf")
```
![alt text](./examples/my_example_2.jpg "Example 2")# 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# Citation
If you use this library and would like to cite it, you can use:
```
R. Cordeiro, "NNV: Neural Network Visualizer", 2019. [Online]. Available: https://github.com/renatosc/nnv. [Accessed: DD- Month- 20YY].
```or:
```
@Misc{,
author = {Renato Cordeiro},
title = {NNV: Neural Network Visualizer},
month = may,
year = {2019},
note = {Online; accessed },
url = {https://github.com/renatosc/nnv},
}
```