Metadata-Version: 2.4
Name: visualtorch
Version: 1.0.0
Summary: Architecture visualization of Torch models
Home-page: https://github.com/willyfh/visualtorch
Author: Willy Fitra Hendria
Author-email: willyfitrahendria@gmail.com
License: MIT
Keywords: visualize architecture,torch visualization,visualtorch
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pillow>=10.0.0
Requires-Dist: numpy>=1.18.1
Requires-Dist: aggdraw>=1.3.11
Requires-Dist: torch>=2.0.0
Provides-Extra: dev
Requires-Dist: myst-parser; extra == "dev"
Requires-Dist: nbsphinx; extra == "dev"
Requires-Dist: pandoc; extra == "dev"
Requires-Dist: sphinx<7.0; extra == "dev"
Requires-Dist: sphinx_autodoc_typehints; extra == "dev"
Requires-Dist: sphinx_book_theme; extra == "dev"
Requires-Dist: sphinx-copybutton; extra == "dev"
Requires-Dist: sphinx_design; extra == "dev"
Requires-Dist: sphinx_gallery; extra == "dev"
Requires-Dist: matplotlib; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

<div align="center">
 <h1>🔥 VisualTorch 🔥</h1>

[![python](https://img.shields.io/badge/python-3.10%2B-blue)]() [![pytorch](https://img.shields.io/badge/pytorch-2.0%2B-orange)]() [![Downloads](https://static.pepy.tech/personalized-badge/visualtorch?period=total&units=international_system&left_color=grey&right_color=green&left_text=PyPI%20Downloads)](https://pepy.tech/project/visualtorch) [![Run Tests](https://github.com/willyfh/visualtorch/actions/workflows/pytest.yml/badge.svg)](https://github.com/willyfh/visualtorch/actions/workflows/pytest.yml) [![Documentation Status](https://readthedocs.org/projects/visualtorch/badge/?version=latest)](https://visualtorch.readthedocs.io/en/latest/?badge=latest)

</div>

**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](https://github.com/paulgavrikov/visualkeras), [pytorchviz](https://github.com/szagoruyko/pytorchviz), and [pytorch-summary](https://github.com/sksq96/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!

<div align="center">

![VisualTorch Examples](docs/source/_static/images/banners/readme-examples.png)

</div>

## Documentation

Online documentation is available at [visualtorch.readthedocs.io](https://visualtorch.readthedocs.io/en/latest/).

The docs include [usage examples](https://visualtorch.readthedocs.io/en/latest/usage_examples/index.html), [API references](https://visualtorch.readthedocs.io/en/latest/markdown/api_references/index.html), and other useful information.

## Installation

See the [Installation page](https://visualtorch.readthedocs.io/en/latest/markdown/get_started/installation.html).

## Examples

See the [Usage Examples page](https://visualtorch.readthedocs.io/en/latest/usage_examples/index.html).

## Contributing

Please feel free to send a pull request to contribute to this project by following this [guideline](https://github.com/willyfh/visualtorch/blob/main/CONTRIBUTING.md).

## License

This poject is available as open source under the terms of the [MIT License](https://github.com/willyfh/visualtorch/blob/main/LICENSE).

Originally, this project was based on the [visualkeras](https://github.com/paulgavrikov/visualkeras) (under the MIT license), with additional modifications inspired by [pytorchviz](https://github.com/szagoruyko/pytorchviz), and [pytorch-summary](https://github.com/sksq96/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](https://visualtorch.readthedocs.io/en/latest/)
for the current API) - the DOI always resolves to what was actually reviewed and published, so
it isn't updated to match.

```bibtex
@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}
}
```
