visualtorch  by willyfh

PyTorch neural network architecture visualization tool

Created 2 years ago
306 stars

Top 87.4% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

VisualTorch is a Python library designed to visualize PyTorch neural network architectures, supporting flow, graph, and LeNet styles. It aids researchers and developers in understanding and debugging complex model structures by providing clear graphical representations of model topology.

How It Works

The library employs a tracing-based approach, executing a forward pass with a dummy input to dynamically build the network diagram. This method allows for visualization of both PyTorch Sequential and custom models, leveraging a unified tracing backend and architecture-handling logic that extends beyond its initial inspirations.

Quick Start & Requirements

  • Installation: pip install visualtorch or pip install "visualtorch[mcp]" for MCP integration.
  • Prerequisites: Python 3.10+ and PyTorch 2.0+.
  • Documentation: Available at visualtorch.readthedocs.io, including usage examples and API references.

Highlighted Details

  • Supports multiple visualization styles: flow, graph, and LeNet.
  • Features a unified tracing backend for robust architecture handling.
  • Includes optional MCP server integration for generating diagrams from model source code.
  • Has been utilized in published research across journals like Nature, IEEE, and MDPI.

Maintenance & Community

Contributions are welcomed. Release methodology is detailed in GOVERNANCE.md, with past releases available on PyPI. No explicit community channels like Discord or Slack are listed.

Licensing & Compatibility

Distributed under the MIT License, ensuring broad compatibility for commercial use and integration into closed-source projects. The project builds upon other MIT-licensed libraries.

Limitations & Caveats

As a tracing-based tool, VisualTorch cannot fully represent models with data-dependent control flow, as only the executed branch from the dummy input is visualized. Additionally, for layers returning multiple tensors, the primary node representation is based on the first output, though all output shapes can be displayed.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
0 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Roy Frostig Roy Frostig(Coauthor of JAX; Research Scientist at Google DeepMind), and
8 more.

penzai by google-deepmind

0%
2k
JAX research toolkit for neural network building, editing, and visualization
Created 2 years ago
Updated 1 year ago
Feedback? Help us improve.