Skip to content

A python utility for plotting neural network (and other) diagrams

License

Notifications You must be signed in to change notification settings

nhansendev/PyDrawNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyDrawNet

A python utility for plotting neural network (and other) diagrams

ConvEx1 DenseEx1 ResEx1 BlockEx2

Example files and this notebook have been created to demonstrate the capabilities of the project.

Requirements

  • python 3+ (tested on 3.12 only)
  • matplotlib (tested on 3.8.1 only)

How It Works

Layers

Layers are classes that represent "objects", like nodes or images. They create one or more matplotlib collections for rendering, as well as holding useful graphic properties like corner coordinates and total height/width.

layers

Operations

Operations are classes that create connections between layers, such as convolutions, dense lines, or arrows. They create one or more matplotlib collections for rendering and can be combined (overlaid) arbitrarily.

operations

Renderers

Currently two renderers are implemented:

  • The sequential renderer class (SeqRenderer) renders layers one after another from left to right, with operations connecting adjacent layers (no skip-connections).
  • The free-form renderer class (FreeformRenderer) requires layers to be specified with unique IDs, which operations are then attached to. All placement is manual except where automatic vertical centering is used (default).

Normally, the renderers call plt.show, but this can be disabled to allow further customization outside of their capabilites.

Installation

From within pydrawnet folder:

pip install .

To uninstall:

pip uninstall pydrawnet

Basic Usage

See the examples notebook.

About

A python utility for plotting neural network (and other) diagrams

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages