Skip to main content

A Library for visualizing Neural Networks.

Project description

Neural Plot

PyPI version Python version PyPI license Open In Colab

Neural Plot is a python library for visualizing Neural Networks. It helps to plot Keras/Tensorflow model with matplotlib backend.

Installation

Run the following to install:

$ pip install neuralplot

Example

# Importing Libraries
from neuralplot import ModelPlot
import tensorflow as tf
import numpy as np
# Uncomment while using Colab.
# %matplotlib inline 

# Uncomment while using jupyter notebook. This feature is not working in colab.
%matplotlib notebook 
#Creating Model
X_input = tf.keras.layers.Input(shape=(32,32,3))
X = tf.keras.layers.Conv2D(4, 3, activation='relu')(X_input)
X = tf.keras.layers.MaxPool2D(2,2)(X)
X = tf.keras.layers.Conv2D(16, 3, activation='relu')(X)
X = tf.keras.layers.MaxPool2D(2,2)(X)
X = tf.keras.layers.Conv2D(8, 3, activation='relu')(X)
X = tf.keras.layers.MaxPool2D(2,2)(X)
X = tf.keras.layers.Flatten()(X)
X = tf.keras.layers.Dense(10, activation='relu')(X)
X = tf.keras.layers.Dense(2, activation='softmax')(X)

model = tf.keras.models.Model(inputs=X_input, outputs=X)
modelplot = ModelPlot(model=model, grid=True, connection=True, linewidth=0.1)
modelplot.show()

modelplot with grid

modelplot = ModelPlot(model=model, grid=False, connection=True, linewidth=0.1)
modelplot.show()

modelplot with grid

License

MIT

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

neuralplot-0.0.8.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

neuralplot-0.0.8-py3-none-any.whl (4.6 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