Skip to main content

Architecture visualization of Torch models

Project description

🔥 VisualTorch 🔥

python pytorch Downloads Run Tests Documentation Status

VisualTorch aims to help visualize Torch-based neural network architectures. It currently supports generating flow-style, graph-style, and LeNet-style architectures for PyTorch Sequential and Custom models. This tool is adapted from visualkeras, pytorchviz, and pytorch-summary.

Note: VisualTorch traces a real forward pass to build the diagram, which has two inherent limitations shared by any tracing-based approach (not bugs, and not fixable without full symbolic execution): (1) models with data-dependent control flow (e.g. a branch only taken if a tensor value crosses some threshold) only show whichever branch the traced dummy input happened to take; (2) a layer that returns multiple meaningful output tensors (e.g. a custom multi-task head) only has its first tensor's shape reflected in that node's size/label - its downstream connections are still correct either way. Contributions are welcome!

VisualTorch Examples

Documentation

Online documentation is available at visualtorch.readthedocs.io.

The docs include usage examples, API references, and other useful information.

Installation

See the Installation page.

Examples

See the Usage Examples page.

Contributing

Please feel free to send a pull request to contribute to this project by following this guideline.

License

This poject is available as open source under the terms of the MIT License.

Originally, this project was based on the visualkeras (under the MIT license), with additional modifications inspired by pytorchviz, and pytorch-summary, both of which are also licensed under the MIT license.

Citation

Please cite this project in your publications if it helps your research.

Note: the paper below describes the API as of its publication date (2024). VisualTorch has since had breaking API changes (see the documentation for the current API) - the DOI always resolves to what was actually reviewed and published, so it isn't updated to match.

@article{Hendria2024,
  doi = {10.21105/joss.06678},
  url = {https://doi.org/10.21105/joss.06678},
  year = {2024},
  publisher = {The Open Journal},
  volume = {9},
  number = {102},
  pages = {6678},
  author = {Willy Fitra Hendria and Paul Gavrikov},
  title = {VisualTorch: Streamlining Visualization for PyTorch Neural Network Architectures},
  journal = {Journal of Open Source Software}
}

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

visualtorch-1.0.0.tar.gz (46.1 kB view details)

Uploaded Source

Built Distribution

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

visualtorch-1.0.0-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

Details for the file visualtorch-1.0.0.tar.gz.

File metadata

  • Download URL: visualtorch-1.0.0.tar.gz
  • Upload date:
  • Size: 46.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for visualtorch-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ef4ef72287ceee2297478b990124b3c47427a33c17b166be87b2eef0ab6e6eab
MD5 04e79aec1c67f8418cbc90217167477e
BLAKE2b-256 e0977d42835f5cf991484b570b380b5a1753abf96388a5233547fec14b23339c

See more details on using hashes here.

File details

Details for the file visualtorch-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: visualtorch-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 38.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for visualtorch-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ef11bd841fb3d236bab0bd65e44e2a12da5e984eeff8f885ff903cad43e1b6c
MD5 b4c0f0691de0b6b51039b79c9fc076c9
BLAKE2b-256 9910e7376d2c604be6b8a06a9457b8c2047bc757d845504e3d6b8dd05ae9239f

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