Skip to main content

A Python library for generating machine learning tooling.

Project description

py-gen-ml

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:

  1. 📊 Providing a single, strongly-typed schema definition for configurations.
  2. 🔄 Generating code to manage configuration changes automatically.
  3. 📝 Offering flexible YAML configurations with advanced referencing and variable support.
  4. 🛠️ Generating JSON schemas for real-time YAML validation.
  5. 🔌 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

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

py_gen_ml-0.2.0.tar.gz (5.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_gen_ml-0.2.0-py3-none-any.whl (43.4 kB view details)

Uploaded Python 3

File details

Details for the file py_gen_ml-0.2.0.tar.gz.

File metadata

  • Download URL: py_gen_ml-0.2.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

Hashes for py_gen_ml-0.2.0.tar.gz
Algorithm Hash digest
SHA256 46b2cfa867e0db1bf8d66cb3975a198c17225a3e700b40f059cd648598e85fc8
MD5 55244df678aa1336eaa458220ea86a67
BLAKE2b-256 f1c2f10163d12e8340479d9415e9fc08107658deffc0ee523f6e40ce450559b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_gen_ml-0.2.0.tar.gz:

Publisher: release.yml on jostosh/py-gen-ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_gen_ml-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: py_gen_ml-0.2.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

Hashes for py_gen_ml-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 678389cb94af0742c53ebdf8cc47d1baeae3f38ab13e660e4d00caef24c84c5e
MD5 44ee64a5c6f61483cbd7832f8e0ea722
BLAKE2b-256 8accfaeae7550b433d7fe88288a855f25bbf49bce0cc4eecbd56adc70a0ec4fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_gen_ml-0.2.0-py3-none-any.whl:

Publisher: release.yml on jostosh/py-gen-ml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page