Skip to main content

Publication-quality visualization of PyTorch model architectures

Project description

model-sketch

PyPI version License: Apache 2.0 Docs

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

model_sketch-0.0.11.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

model_sketch-0.0.11-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

Details for the file model_sketch-0.0.11.tar.gz.

File metadata

  • Download URL: model_sketch-0.0.11.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for model_sketch-0.0.11.tar.gz
Algorithm Hash digest
SHA256 92d053c937b57c98b8d93511cd30f97ed2ed8fcb57e202e5639aa3c3ae35cd65
MD5 00277f5c68ce6920912ff611c2ec4679
BLAKE2b-256 3021ac4769ce02d8979193103e0b27fb670b85e0174ec9fe682b77b03f1d8e88

See more details on using hashes here.

File details

Details for the file model_sketch-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: model_sketch-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for model_sketch-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 eeb4a979c76d89c3b0c8c74c42f1679d22fd2feacf168c1858b06cdde98b4aed
MD5 c3f34f7b18e6f4cfaaa9e0f8d6994a6e
BLAKE2b-256 23dc3ec4632ed1f717085aa976c5f84b2911221a748dd298f76b881bcf277638

See more details on using hashes here.

Supported by

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