A hackable blueprint for training neural networks using PyTorch and Lightning.
Project description
A hackable blueprint for training neural networks using PyTorch and Lightning.
Venturi is a minimalist alternative to Hydra and LightningCLI. It prioritizes code transparency and flexibility. By separating experiment parameters from logic, it enables complex experiment registration without the bloat of heavy configuration frameworks.
Why Venturi?
Most configuration frameworks force you to learn their specific DSL or hide logic behind complex abstractions. Venturi takes a different approach:
- Auditable Core: The entire package logic resides in just two files:
config.pyandcore.py. You can read, understand, and modify the inner workings. - Zero-Overhead Configuration: No enforced
argparseorpydanticvalidation by default. You instantiate Python objects directly from YAML. Validation is opt-in, not mandatory. - Global Context: The full YAML configuration is passed to the main classes used for training. This allows you to define complex relationships (e.g., dynamically setting model depth based on dataset size) without changing the training loop.
- Inheritance-First Design: The experiment lifecycle is defined by classes designed to be subclassed when custom training logic is necessary.
Installation
Install the core package:
pip install venturi
To run the provided examples, install the optional dependencies:
pip install "venturi[examples]"
Quick Start
1. Scaffold a Project
Generate a standard directory structure and a default configuration file:
venturi create path/to/project
This creates a base_config.yaml file containing the default blueprints.
2. Define Your Experiment
Venturi uses a hierarchical configuration system. You load a base configuration and override it with experiment-specific YAMLs.
from venturi import Config, Experiment
# 1. Load the project defaults
args = Config("base_config.yaml")
# 2. Overlay custom experiment parameters
args.update_from_yaml("experiments/my_custom_config.yaml")
# 3. Initialize and Run
experiment = Experiment(args)
experiment.fit()
Examples
Some examples are provided in the examples directory:
| Example | Description |
|---|---|
| Configuration | The core concept: instantiating arbitrary Python objects directly from YAML and mixing multiple config files |
| Basic Usage | A complete image segmentation experiment setup |
| Base Config | The reference file describing all standard Venturi parameters |
Design Philosophy
Venturi is built on the principle that research code should be hackable.
- Transparency: You should not have to dig through a call stack of 50 internal functions to understand how your configurations are parsed.
- Flexibility: If you want to add Pydantic validation, you can add it before passing the config to the
Experimentclass. It is not baked into the core. - Portability: By avoiding complex CLI dependency injection, your experiments remain standard Python scripts that are easy to debug and deploy.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file venturi-0.9.1.tar.gz.
File metadata
- Download URL: venturi-0.9.1.tar.gz
- Upload date:
- Size: 70.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0203b9e7f8a1a06d41580ff307c3c39c7735f313f8aaa63964ec09a4d25b22fd
|
|
| MD5 |
c0ab39a015908b5f9fa39dcfdcac4838
|
|
| BLAKE2b-256 |
a908223a09e75c8803f5b6a6ac000ab3b771ce3269055454956a535a1225bc35
|
File details
Details for the file venturi-0.9.1-py3-none-any.whl.
File metadata
- Download URL: venturi-0.9.1-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31c5e5a3309ca82e2564fa1bb8f84791b8dc333c4541003cbafadd04cbda2680
|
|
| MD5 |
ca7c2af1d53ffdc24d3937b38e17f9da
|
|
| BLAKE2b-256 |
14763e677562b54ed0d30cf9070fa3441b64dff17f970e869bcf6349c84bf701
|