Tiny train logger
Project description
🚅🪵 Tiny Train Log 🚅🪵
Structured, queryable logging for ML experiments. Track metrics across machines, merge results into one SQLite database, and analyze everything with plain SQL.
Quick start
pip install tinytrainlog
from tinytrainlog import MetricsLogger
with MetricsLogger("./runs", run_name="lr-sweep-3e4") as log:
log.set_config({"model": "resnet50", "lr": 3e-4, "epochs": 10})
log.add_tags(["sweep", "baseline"])
for epoch in range(10):
train_loss = train(model, loader)
log.log_epoch(epoch=epoch, train_loss=train_loss)
val_loss, val_acc = evaluate(model, val_loader)
log.log_eval(epoch=epoch, val_loss=val_loss, val_acc=val_acc)
torch.save(model.state_dict(), log.checkpoint_path(epoch=epoch))
log.log_test(test_acc=0.94, test_loss=0.21)
Everything lands in a single runs.db SQLite file — query it however you like:
import sqlite3
conn = sqlite3.connect("./runs/runs.db")
# Compare learning rates across runs
conn.execute("""
SELECT c.run_name, c.value AS lr, e.value AS val_acc
FROM config c
JOIN eval e USING (run_name)
WHERE c.key = 'lr' AND e.key = 'val_acc'
ORDER BY CAST(e.value AS REAL) DESC
""").fetchall()
Multi-server merging
Ran experiments on multiple machines? Merge them into one database:
MetricsLogger.merge(target_dir="./all_runs", source_dir="/mnt/gpu-box-1/runs")
MetricsLogger.merge(target_dir="./all_runs", source_dir="/mnt/gpu-box-2/runs")
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 tinytrainlog-0.1.4.tar.gz.
File metadata
- Download URL: tinytrainlog-0.1.4.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8528e058be01c838629e26f21427ea81db1b683c1aede54ed6860df2427caeac
|
|
| MD5 |
69bd20e0443dbc7de75f68227282e308
|
|
| BLAKE2b-256 |
fee798233b41b3ef5c71b183d742528b8bb2158e3006fb0e32061282073a7d7d
|
Provenance
The following attestation bundles were made for tinytrainlog-0.1.4.tar.gz:
Publisher:
python-publish.yml on jdhouseholder/tinytrainlog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tinytrainlog-0.1.4.tar.gz -
Subject digest:
8528e058be01c838629e26f21427ea81db1b683c1aede54ed6860df2427caeac - Sigstore transparency entry: 1194396701
- Sigstore integration time:
-
Permalink:
jdhouseholder/tinytrainlog@52b9c400b75d4a8c5f0a626e6a338773c14cc737 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/jdhouseholder
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@52b9c400b75d4a8c5f0a626e6a338773c14cc737 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tinytrainlog-0.1.4-py3-none-any.whl.
File metadata
- Download URL: tinytrainlog-0.1.4-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dce14c43115e59e8875903e075bbacb959b5eb2122907eb5211e68d25ce7c5f1
|
|
| MD5 |
d6961a879cb2a92a286e5899f0e8a1be
|
|
| BLAKE2b-256 |
3ea1322e6e5fdbdfa12ce2126ad6357faaefd83e8a3617f34b3bba67cf6a2f0d
|
Provenance
The following attestation bundles were made for tinytrainlog-0.1.4-py3-none-any.whl:
Publisher:
python-publish.yml on jdhouseholder/tinytrainlog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tinytrainlog-0.1.4-py3-none-any.whl -
Subject digest:
dce14c43115e59e8875903e075bbacb959b5eb2122907eb5211e68d25ce7c5f1 - Sigstore transparency entry: 1194396709
- Sigstore integration time:
-
Permalink:
jdhouseholder/tinytrainlog@52b9c400b75d4a8c5f0a626e6a338773c14cc737 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/jdhouseholder
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@52b9c400b75d4a8c5f0a626e6a338773c14cc737 -
Trigger Event:
release
-
Statement type: