Metadata-Version: 2.5
Name: drytorch
Version: 0.1.0
Summary: This package helps train, document and evaluate a Pytorch model.
Project-URL: Repository, https://github.com/nverchev/drytorch
Project-URL: Issues, https://github.com/nverchev/drytorch/issues
Project-URL: Changelog, https://github.com/nverchev/drytorch/blob/master/CHANGELOG.md
Author-email: Nicolas Vercheval <nicolas.vercheval@ugent.be>
License: MIT License
        
        Copyright (c) 2025 Nicolas Vercheval
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: logger,pytorch
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Python: >=3.11
Requires-Dist: filelock>=3.21.0
Requires-Dist: numpy>=1.26.0
Requires-Dist: torch>=2.10.0
Requires-Dist: typing-extensions>=4.4.0
Provides-Extra: all-trackers
Requires-Dist: hydra-core>=1.3.0; extra == 'all-trackers'
Requires-Dist: ipython>=8.12.0; extra == 'all-trackers'
Requires-Dist: matplotlib>=3.11.0; extra == 'all-trackers'
Requires-Dist: omegaconf>=2.3.0; extra == 'all-trackers'
Requires-Dist: plotly>=4.10.0; extra == 'all-trackers'
Requires-Dist: pyyaml>=6.0; extra == 'all-trackers'
Requires-Dist: sqlalchemy>=2.0.12; extra == 'all-trackers'
Requires-Dist: tensorboard>=2.17.0; extra == 'all-trackers'
Requires-Dist: tqdm>=4.50.0; extra == 'all-trackers'
Requires-Dist: wandb>=0.20.0; extra == 'all-trackers'
Provides-Extra: dev
Requires-Dist: hypothesis>=0.1.0; extra == 'dev'
Requires-Dist: jupytext==1.19.6; extra == 'dev'
Requires-Dist: pre-commit>=4.3.0; extra == 'dev'
Requires-Dist: pytest-cov>=2.12.1; extra == 'dev'
Requires-Dist: pytest-mock>=3.4.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff==0.17.1; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-nb; extra == 'docs'
Requires-Dist: sphinx; extra == 'docs'
Requires-Dist: sphinx-rtd-theme; extra == 'docs'
Requires-Dist: sphinxcontrib-mermaid>=2; extra == 'docs'
Provides-Extra: recommended
Requires-Dist: pyyaml>=6.0; extra == 'recommended'
Requires-Dist: tqdm>=4.50.0; extra == 'recommended'
Provides-Extra: support
Requires-Dist: ipywidgets; extra == 'support'
Requires-Dist: notebook; extra == 'support'
Requires-Dist: optuna>=4.0.0; extra == 'support'
Requires-Dist: pandas>=2.3.0; extra == 'support'
Requires-Dist: pillow>=10.0.1; extra == 'support'
Requires-Dist: torcheval; extra == 'support'
Requires-Dist: torchmetrics>=1.0.0; extra == 'support'
Provides-Extra: type
Requires-Dist: basedpyright==1.40.2; extra == 'type'
Requires-Dist: pandas-stubs; extra == 'type'
Requires-Dist: plotly-stubs; extra == 'type'
Requires-Dist: types-pyyaml; extra == 'type'
Requires-Dist: types-tqdm; extra == 'type'
Description-Content-Type: text/markdown

![drytorch_logo.png](https://raw.githubusercontent.com/nverchev/drytorch/main/docs/_static/drytorch_logo.png)
[![PyPI version](https://img.shields.io/pypi/v/drytorch.svg?style=flat)](https://pypi.org/project/drytorch/)
[![Total Downloads](https://img.shields.io/pypi/dm/drytorch?label=downloads&style=flat)](https://pypi.org/project/drytorch/)
[![Python](https://img.shields.io/pypi/pyversions/drytorch.svg?style=flat)](https://pypi.org/project/drytorch/)
[![License](https://img.shields.io/pypi/l/drytorch.svg)](https://github.com/nverchev/drytorch/blob/master/LICENSE)
[![CI Status](https://github.com/nverchev/drytorch/actions/workflows/ci.yaml/badge.svg)](https://github.com/nverchev/drytorch/actions/workflows/ci.yaml)
[![codecov](https://codecov.io/github/nverchev/drytorch/graph/badge.svg?token=CZND67KAW1)](https://codecov.io/github/nverchev/drytorch)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![basedpyright - checked](https://img.shields.io/badge/basedpyright-checked-ffc000)](https://docs.basedpyright.com)
[![Documentation Status](https://readthedocs.org/projects/drytorch/badge/?version=latest)](https://drytorch.readthedocs.io/latest/?badge=latest)
# DRYTorch
Reproducible machine learning experiments with PyTorch.

## Design
Don't Repeat Yourself (DRY) principles: replicable, documented, reusable.

* **Reproducibility:** experimental isolation to prevent unintended dependencies, data leakage, and misconfiguration.
* **Modularity:** flexible protocols preserving type inference in custom implementations.
* **Type Checking:** support for type checkers (such as basedpyright) for static detection of incompatible components.
* **Decoupled Tracking:** execution independent of tracking events (logging, plotting, and storing metadata).
* **Optional Dependencies:** support for external libraries (Hydra, W&B, TensorBoard, etc.) but minimal requirements.
* **Self-Documentation:** automatic metadata extraction and standardization.
* **Ready-to-use:** high-level implementations for advanced applications and workflows.

## Installation

**Requirements:**
- The library only requires recent versions of **PyTorch** and **NumPy**.
- **PyYAML** and **tqdm** are recommended.

**pip:**
```bash
pip install drytorch
```

**uv:**
```bash
uv add drytorch
```

## Project Template

To start a new project, use
**[drytorch-template](https://github.com/nverchev/drytorch_template)**. It is a
complete machine learning project, with Hydra configuration, custom trackers, Optuna
tuning and distributed training, and its README explains which files to change
for your task.

## Package Structure
Modules are organized into the following subpackages:

- **`core`:** internal routines and the interfaces for library and custom components.
- **`lib`:** reusable implementations and abstract classes of the protocols.
- **`trackers`:** optional tracker plugins that integrate via the event system.
- **`contrib`:** community-driven extensions and support for external libraries.
- **`utils`:** general utilities independent to the framework.


## Documentation

Comprehensive documentation is available on **[Read the Docs](https://drytorch.readthedocs.io/)**.

### Tutorials

| Tutorial | Description |
| :--- | :--- |
| [Getting Started](https://drytorch.readthedocs.io/latest/tutorials/getting_started.html) | End-to-end tutorial on deep image prior super-resolution. |
| [Experiments and Runs](https://drytorch.readthedocs.io/latest/tutorials/experiments_and_runs.html) | Defining experiments, run sessions, and registries. |
| [Data](https://drytorch.readthedocs.io/latest/tutorials/data.html) | Data loaders and dataset splitting. |
| [Models](https://drytorch.readthedocs.io/latest/tutorials/models.html) | Module wrappers and checkpointing. |
| [Objectives](https://drytorch.readthedocs.io/latest/tutorials/objectives.html) | Losses, metrics, and accumulators. |
| [Learning](https://drytorch.readthedocs.io/latest/tutorials/learning.html) | Optimizers, learning rate schemas, and schedulers. |
| [Training](https://drytorch.readthedocs.io/latest/tutorials/training.html) | Trainer configuration, validation, hooks, and Optuna tuning. |
| [Trackers](https://drytorch.readthedocs.io/latest/tutorials/trackers.html) | Logging metrics, plots, and run states. |
| [Events](https://drytorch.readthedocs.io/latest/tutorials/events.html) | Domain-specific signals, event types, and tracker integration. |
| [Distributed Training](https://drytorch.readthedocs.io/latest/tutorials/distributed_training.html) | Multi-process distributed training with DDP. |
| [Typing Support](https://drytorch.readthedocs.io/latest/tutorials/typing_support.html) | Multi-modal inputs, custom model outputs, and type safety. |

### Reference

- **[API Reference](https://drytorch.readthedocs.io/latest/api.html)**: detailed API documentation.
- **[Protocol Overview](https://drytorch.readthedocs.io/latest/protocols.html)**: design structure and protocols.
- **[Changelog](https://github.com/nverchev/drytorch/blob/main/CHANGELOG.md)**: release history and migration notes.
