Publication-quality visualization of PyTorch model architectures
Project description
model-sketch
Image generated by AI
Python package for generating publication-quality visualizations of PyTorch model architectures. It focuses on clean SVG output, optional PNG export, and a simple API for sketching models from example forward inputs.
Installation
Base installation:
pip install model-sketch
If you also want PNG export support (CairoSVG backend), install the optional PNG extras:
pip install model-sketch[png]
Examples
Explore practical examples demonstrating model-sketch features:
| Example | Description | Notebook | Colab |
|---|---|---|---|
| Tiny MLP sketch | Build a small MLP, render SVG/PNG, and save outputs to files. | simple_model.ipynb | Open in Colab |
| Semantic options demo | Compare semantic_view='blocks' vs semantic_view='layers' and semantic spacing on a larger model. |
semantic_options.ipynb | Open in Colab |
| Edge style options demo | Compare edge_style='straight' and edge_style='orthogonal' with arrowheads on a branching model. |
edge_style_options.ipynb | Open in Colab |
| Repeated patterns demo | Inspect repeated motif behavior across layers and blocks views, including repeated highlights and collapsed motifs. | repeated_patterns_demo.ipynb | Open in Colab |
| Model diff demo | Compare baseline and candidate models, then inspect added/removed/shared architecture labels. | model_diff_demo.ipynb | Open in Colab |
| Architecture coverage demo | Run CNN, BiLSTM, BiGRU, Transformer, multi-input, dict-output, and UNet-like examples through the same sketch pipeline. | architecture_coverage.ipynb | Open in Colab |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file model_sketch-0.0.10.tar.gz.
File metadata
- Download URL: model_sketch-0.0.10.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7182b86699d0f91051d2837365ac95c2e898bfb67426f68ad36380fff4ed271b
|
|
| MD5 |
9e2f8a062aa7b4efa46b25b2ce3cac4c
|
|
| BLAKE2b-256 |
2b6a9da90061e1b34d985d6f2cde04d2144df167dc070e544d2ecb5ff4e6774c
|
File details
Details for the file model_sketch-0.0.10-py3-none-any.whl.
File metadata
- Download URL: model_sketch-0.0.10-py3-none-any.whl
- Upload date:
- Size: 32.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a9c8d2fa817d699549aeb8c5b4bd2470abd8eaccd033094b02dfbe8f9d87d79
|
|
| MD5 |
fc58c8e428f573260e0f9f2d177fbf57
|
|
| BLAKE2b-256 |
d04832664d0c07cb6c061b92d425f8e5c180760388226a292ba41fbeca45f7ae
|