Skip to content

[Ecosystem] VisualTorch #39

@willyfh

Description

@willyfh

Contact emails

[email protected]

Project summary

A PyTorch model visualization library for generating publication-ready diagrams of neural network architectures.

Project description

VisualTorch is a visualization toolkit designed for PyTorch users to generate clean, publication-ready diagrams of neural network architectures with a single function call. It supports multiple visualization styles, layered, graph-style, and LeNet-style, and works seamlessly with both nn.Sequential and custom nn.Module models.

Given a model and input shape, VisualTorch traces a forward pass using dummy input and automatically renders an architectural diagram. The output can be customized with options such as color, opacity, sizing, and legends, making it suitable for debugging, teaching, and scientific publications.

The library fills a long-standing gap in the PyTorch ecosystem by providing an inline, framework-native visualization tool.

The project is open-source under the MIT license and supported by web-based documentation, and CI/CD workflows. VisualTorch has also been published in the Journal of Open Source Software (JOSS).

Are there any other projects in the PyTorch Ecosystem similar to yours? If, yes, what are they?

Similar projects include:

  • VisualKeras: a visualization tool for Keras models that inspired VisualTorch.

VisualTorch is distinct in its tight integration with PyTorch, its ease of use within Python scripts and notebooks. It allows rapid, high-quality visualization with minimal user effort, making it ideal for researchers and engineers working in PyTorch.

Project repo URL

https://github.com/willyfh/visualtorch

Additional repos in scope of the application

No response

Project license

MIT

GitHub handles of the project maintainer(s)

willyfh

Is there a corporate or academic entity backing this project? If so, please provide the name and URL of the entity.

No official backing. Developed by an independent researcher.

Website URL

https://visualtorch.readthedocs.io/en/latest/

Documentation

Yes. The documentation is hosted on ReadTheDocs:

https://visualtorch.readthedocs.io/en/latest/

It includes:

  • Getting started and installation
  • Multiple usage examples (layered, graph, LeNet)
  • Full API reference
  • Developer and contribution guides
  • Citation metadata

How do you build and test the project today (continuous integration)? Please describe.

VisualTorch uses GitHub Actions for continuous integration and release automation. Every pull request and push to the main branch triggers automated workflows that include:

  • Pre-commit checks using pre-commit and ruff for code formatting, linting, and static analysis
  • Static type checking with mypy to ensure type safety across the codebase
  • Unit testing using pytest to validate functionality across supported model types and visualization styles
  • Dependency management via optional development extras (pip install -e .[dev]), ensuring reproducibility across environments

Contributors follow a documented setup process that includes environment creation, pre-commit installation, and test verification. CI ensures that every contribution adheres to the project’s quality standards before merging.

In addition, VisualTorch uses GitHub Actions for automated release publishing to PyPI, making new versions available as soon as they are tagged and validated—streamlining distribution and ensuring users always have access to the latest stable version.

Version of PyTorch

Compatible and tested with PyTorch ≥ 2.0+

Components of PyTorch

  • torch.nn.Module: for model parsing and layer introspection
  • torch.Tensor: for shape tracing during the forward pass

How long do you expect to maintain the project?

Committed to maintaining the project for at least 10 more years, including updates for new PyTorch releases and ongoing feature enhancements. Actively maintained on GitHub with CI pipelines and public issue tracking.

Additional information

VisualTorch has been peer-reviewed and published in the Journal of Open Source Software (JOSS):

Citation:
Willy Fitra Hendria & Paul Gavrikov. (2024). VisualTorch: Streamlining Visualization for PyTorch Neural Network Architectures. JOSS. DOI

The library has gained adoption among researchers needing quick, publication-ready model diagrams. It is designed to be framework-native, beginner-friendly, and production-agnostic—ideal for debugging, teaching, and scientific communication.

PyPI: https://pypi.org/project/visualtorch
Install via: pip install visualtorch

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions