A Python library for generating machine learning tooling.
Project description
py-gen-ml, generate machine learning code from a protobuf schema.
Documentation: https://jostosh.github.io/py-gen-ml
🌟 Project Introduction
py-gen-ml simplifies the configuration and management of machine learning projects. It leverages Protocol Buffers (protobufs) to provide a robust, strongly typed, and extensible way to define and manipulate configuration schemas for machine learning projects.
🔑 Key Features
📌 Single Source of Truth:
- The Protobuf schema provides a centralized definition for your configurations.
🔧 Flexible Configuration Management:
- Minimal Change Amplification: Automatically generated code reduces cascading manual changes when modifying configurations.
- Flexible Patching: Easily modify base configurations with patches for quick experimentation.
- Flexible YAML: Use human-readable YAML with support for advanced references within and across files.
- Hyperparameter Sweeps: Effortlessly define and manage hyperparameter tuning.
- CLI Argument Parsing: Automatically generate command-line interfaces from your configuration schemas.
✅ Validation and Type Safety:
- JSON Schema Generation: Easily validate your YAML content as you type.
- Strong Typing: The generated code comes with strong typing that will help you, your IDE, the type checker and your team to better understand the codebase and to build more robust ML code.
🚦 Getting Started
To start using py-gen-ml, you can install it via pip:
pip install py-gen-ml
For a quick example of how to use py-gen-ml in your project, check out our Quick Start Guide.
💡 Motivation
Machine learning projects often involve complex configurations with many interdependent parameters. Changing one config (e.g., the dataset) might require adjusting several other parameters for optimal performance. Traditional approaches to organizing configs can become unwieldy and tightly coupled with code, making changes difficult.
py-gen-ml addresses these challenges by:
- 📊 Providing a single, strongly-typed schema definition for configurations.
- 🔄 Generating code to manage configuration changes automatically.
- 📝 Offering flexible YAML configurations with advanced referencing and variable support.
- 🛠️ Generating JSON schemas for real-time YAML validation.
- 🔌 Seamlessly integrating into your workflow with multiple experiment running options:
- Single experiments with specific config values
- Base config patching
- Parameter sweeps via JSON schema validated YAML files
- Quick value overrides via a generated CLI parser
- Arbitrary combinations of the above options
This approach results in more robust ML code, leveraging strong typing and IDE support while avoiding the burden of change amplification in complex configuration structures.
🎯 When to use py-gen-ml
Consider using py-gen-ml when you need to:
- 📈 Manage complex ML projects more efficiently
- 🔬 Streamline experiment running and hyperparameter tuning
- 🛡️ Reduce the impact of configuration changes on your workflow
- 💻 Leverage type safety and IDE support in your ML workflows
📚 Where to go from here
- Quickstart: A quick intro to the most important concepts.
- Command Line Interface: How to use the generated CLI parser.
- Parameter Sweeps: How to run parameter sweeps.
- Generated factories: How to generate factories to instantiate your classes.
- Cifar 10 example project: A more elaborate example of a machine learning project using
py-gen-ml.
Project details
Release history Release notifications | RSS feed
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 py_gen_ml-0.3.0.tar.gz.
File metadata
- Download URL: py_gen_ml-0.3.0.tar.gz
- Upload date:
- Size: 5.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cb5649d3bbc8d19fb1490c5f9dd0595b0395d7cf35013ddc7b2133ac97b564f
|
|
| MD5 |
9b0135e75a747fefcc815cc2f33aa167
|
|
| BLAKE2b-256 |
d8119017dfde47b9985c4234d10af646944621d7f90f8f00af723cc84ae918cf
|
Provenance
The following attestation bundles were made for py_gen_ml-0.3.0.tar.gz:
Publisher:
release.yml on jostosh/py-gen-ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_gen_ml-0.3.0.tar.gz -
Subject digest:
4cb5649d3bbc8d19fb1490c5f9dd0595b0395d7cf35013ddc7b2133ac97b564f - Sigstore transparency entry: 152687376
- Sigstore integration time:
-
Permalink:
jostosh/py-gen-ml@7036264e09f307676f0f43cd752357ff6fb2bedb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jostosh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7036264e09f307676f0f43cd752357ff6fb2bedb -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file py_gen_ml-0.3.0-py3-none-any.whl.
File metadata
- Download URL: py_gen_ml-0.3.0-py3-none-any.whl
- Upload date:
- Size: 43.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df8f902c0b692155b81135e5e34f4cb1fb08d494f74b42f2c4a1d0a2e6648cab
|
|
| MD5 |
b7f78c1cf6846cc924a065d11abc3024
|
|
| BLAKE2b-256 |
fa82a9a30cb72b4f152fb4bed3bdabbcf92abe4b7b7fe18473a60595122f7ac5
|
Provenance
The following attestation bundles were made for py_gen_ml-0.3.0-py3-none-any.whl:
Publisher:
release.yml on jostosh/py-gen-ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_gen_ml-0.3.0-py3-none-any.whl -
Subject digest:
df8f902c0b692155b81135e5e34f4cb1fb08d494f74b42f2c4a1d0a2e6648cab - Sigstore transparency entry: 152687377
- Sigstore integration time:
-
Permalink:
jostosh/py-gen-ml@7036264e09f307676f0f43cd752357ff6fb2bedb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jostosh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7036264e09f307676f0f43cd752357ff6fb2bedb -
Trigger Event:
workflow_dispatch
-
Statement type: