LegoML is a modular library for machine learning workflows. Inspired by Lego blocks, it aims to combine maximum usability with flexibility, enabling you to quickly build robust solutions. |
![]() |
- Generalized training loops
- Modular visualization utilities
- Easy integration with PyTorch
- Extensible for advanced tasks
Install directly from GitHub:
pip install git+https://github.com/Thomas-Rauter/[email protected]
Install legoml with extras
pip install git+https://github.com/Thomas-Rauter/[email protected][torch,tensorflow]
LegoML is designed with a simple yet powerful philosophy: to provide modular, simple, and flexible building blocks for machine learning workflows. Much like LEGO bricks, these components can be easily combined and customized to build solutions tailored to your specific needs.
- Core Principle: Modularity is at the heart of LegoML. Each function or class is a small, self-contained building block that serves a specific purpose.
- Why It Matters: Modularity allows you to mix, match, and replace components as your project evolves, ensuring that your workflow remains adaptable.
- Example: Instead of bundling a rigid, monolithic pipeline, LegoML offers standalone pieces like a
train_one_epoch
function or avisualize_metrics
utility that you can plug into your own training loops or pipelines.
- Core Principle: Simplicity is essential. LegoML functions should be intuitive and require minimal setup to get started.
- Why It Matters: If a building block requires excessive effort to understand or use, you might as well write it yourself. LegoML is designed to save you time, not create additional complexity.
- Example: A general-purpose
train_loop
function abstracts away the boilerplate code for training a PyTorch model while remaining simple enough for anyone familiar with PyTorch to understand.
- Core Principle: Flexibility ensures that the building blocks are adaptable to a wide range of use cases.
- Why It Matters: Special-purpose, overly specific functions often fail to accommodate unique scenarios. LegoML avoids this by prioritizing generality, enabling its components to cover most common use cases in machine learning workflows.
- Example: A single training loop function can accommodate any PyTorch model, optimizer, or learning rate scheduler, instead of being tied to a particular architecture or configuration.
LegoML doesn’t aim to reinvent the wheel; it aims to make your work more efficient. By focusing on modularity, simplicity, and flexibility, it empowers you to focus on solving data science problems rather than spending excessive time on repetitive coding tasks. Whether you're a beginner or a seasoned practitioner, LegoML provides the tools you need to build robust machine learning solutions, brick by brick.