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.3.tar.gz (3.5 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: neural_net_drawer-0.0.3.tar.gz
  • Upload date:
  • Size: 3.5 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.3.tar.gz
Algorithm Hash digest
SHA256 f3d1a4214d5a0a7a0b06d9f7175e86d836e7a542d48b970a087d4d5927ed103c
MD5 2aa59da0bf3fa0cb714745dd40879e05
BLAKE2b-256 f3832b4067e6d37b93b69d578dfba0a4e41afadceb5a7328fcb010d579bbab87

See more details on using hashes here.

Supported by

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