Small self-contained micro packages for deep learning codebases.
Project description
mini-kit
Minimal, hackable building blocks for deep learning projects. The goal is to keep every layer small enough that you can read it, tweak it, or drop it into your own codebase.
Quick Start
pip install mini-kit
You now have three tiny helpers that play nicely together:
mini.configloads plain-Python configs. Start with a single dictionary, then grow into composable templates and parent chains without learning a new DSL.mini.builderturns dictionaries into Python objects. Supports both registry shortcuts and fully qualified import paths.mini.trainerprovides a lightweight training framework with hooks for logging, checkpointing, and customization.
The example below shows mini.config and mini.builder in action.
# configs/model.py
config = {
"model": {
"type": "Classifier",
"encoder": {"type": "Encoder", "channels": 64},
"head": {"type": "torch.nn.Linear", "*": [64, 10]},
},
"optimizer": {"type": "torch.optim.AdamW", "lr": 3e-4},
}
# main.py
from mini.builder import register, build
from mini.config import apply_overrides, load
@register()
class Encoder:
def __init__(self, channels: int):
self.channels = channels
@register()
class Classifier:
def __init__(self, encoder, head):
self.encoder = encoder
self.head = head
cfg = load("configs/model.py")
cfg = apply_overrides(cfg, ["optimizer.lr=1e-3", "model.encoder.channels=128"])
model = build(cfg["model"])
optimizer = build(cfg["optimizer"])
loadexecutesconfigs/model.py; keep a simpleconfig = {...}for small projects, or swap todef config(...):andparents = [...]when you need templates and composition.apply_overridesallows for painless command-line overrides: tweak nested keys with a short-hand syntax:optimizer.lr=..., append with+=, or drop entries with!=.buildlooks at the"type"key, grabs the right constructor (from the registry or import path), and wires up dependencies for you.
More details are in each subpackage's own README:
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 mini_kit-0.2.0.tar.gz.
File metadata
- Download URL: mini_kit-0.2.0.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cad43ea85f3b46d0c3ffbd4c0ccd905df3ca7efe7905a68898ef13c37f3c737f
|
|
| MD5 |
e8f5ff537ebfaa7ba6de9979f37b043a
|
|
| BLAKE2b-256 |
85dccbfc3d1a24fc88e48a1693c724addf3d99d8eebaae524de592a13cfed5c2
|
File details
Details for the file mini_kit-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mini_kit-0.2.0-py3-none-any.whl
- Upload date:
- Size: 30.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8a3a9206155b2659ceba13605f4490c0e8b0a4db9dd20a0fa6328b9358c7baa
|
|
| MD5 |
ababf13ffa5491a752e11f2a2628d9d0
|
|
| BLAKE2b-256 |
407620babbaf3827327a29b0ac7f60a4e36f2bf83702b36994532e857769b987
|