Skip to main content

Plugin for visual display of a neural network.

Project description

# Install the neural-net-drawer package via pip
pip install neural-net-drawer
# Import necessary libraries
import matplotlib.pyplot as plt
from neural_net_drawer.drawer import NeuralNetworkDiagram
# Example usage
fig = plt.figure(figsize=(9, 9))
ax = fig.gca()
ax.axis('off')

# Create an instance of the NeuralNetworkDiagram class
nn_diagram = NeuralNetworkDiagram()

# Call the method to draw the neural network diagram
nn_diagram.draw_neural_net(ax, [7, 5, 4, 3, 4, 2, 1])

plt.show()

# Example usage with customizations
fig = plt.figure(figsize=(9, 9))
ax = fig.gca()
ax.axis('off')

# Create an instance of the NeuralNetworkDiagram class
nn_diagram = NeuralNetworkDiagram()

# Set maximum number of layers to display
nn_diagram.max_n_layers_size = 3

# Set maximum number of neurons per layer to display
nn_diagram.max_layer_size = 10

# Call the method to draw the neural network diagram
nn_diagram.draw_neural_net(ax, [7, 5, 4, 3, 4, 2, 1])

plt.show()

# Example usage with further customizations
fig = plt.figure(figsize=(9, 9))
ax = fig.gca()
ax.axis('off')

# Create an instance of the NeuralNetworkDiagram class
nn_diagram = NeuralNetworkDiagram()

# Set maximum number of layers to display
nn_diagram.max_n_layers_size = 3

# Hide neuron numbers
nn_diagram.show_neuron_numbers = False

# Call the method to draw the neural network diagram
nn_diagram.draw_neural_net(ax, [7, 5, 4, 3, 4, 2, 1])

plt.show()

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

neural_net_drawer-0.0.4.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file neural_net_drawer-0.0.4.tar.gz.

File metadata

  • Download URL: neural_net_drawer-0.0.4.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for neural_net_drawer-0.0.4.tar.gz
Algorithm Hash digest
SHA256 68317c595480fd58437972b13a571da347c1d16fe8aa530d2c7b1534ef9fb5df
MD5 fabb4f8a3d5e09d01f5fdce3b9a789eb
BLAKE2b-256 fba782113ba3073ca290dcc7b8da7ec50c2a4dab4c26d2696df7b8b87e87d395

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