xplogger
Logging utility for ML experiments
Why
People use different tools for logging experimental results - Tensorboard, Wandb etc to name a few. Working with different collaborators, I will have to switch my logging tool with each new project. So I made this simple tool that provides a common interface to logging results to different loggers.
Installation
pip install "xplogger[all]"
If you want to use only the filesystem logger, use pip install "xplogger"
Install from source
git clone git@github.com:shagunsodhani/xplogger.gitcd xploggerpip install ".[all]"
Alternatively, pip install "git+https://git@github.com/shagunsodhani/xplogger.git@master#egg=xplogger[all]"
If you want to use only the filesystem logger, use pip install . or pip install "git+https://git@github.com/shagunsodhani/xplogger.git@master#egg=xplogger".
Documentation
https://shagunsodhani.github.io/xplogger
Use
-
Make a
logbook_config:import xplogger.logbook logbook_config = xplogger.logbook.make_config( logger_dir = <path to write logs>, wandb_config = <wandb config or None>, tensorboard_config = <tensorboard config or None>, mlflow_config = <mlflow config or None>)The API for
make_configcan be accessed here. -
Make a
LogBookinstance:logbook = xplogger.logbook.LogBook(config = logbook_config) -
Use the
logbookinstance:log = { "epoch": 1, "loss": 0.1, "accuracy": 0.2 } logbook.write_metric(log)The API for
write_metriccan be accessed here.
Note
-
If you are writing to wandb, the
logmust have a key calledstep. If yourlogalready captures thestepbut as a different key (sayepoch), you can pass thewandb_key_mapargument (set as{epoch: step}). For more details, refer the documentation here. -
If you are writing to mlflow, the
logmust have a key calledstep. If yourlogalready captures thestepbut as a different key (sayepoch), you can pass themlflow_key_mapargument (set as{epoch: step}). For more details, refer the documentation here. -
If you are writing to tensorboard, the
logmust have a key calledmain_tagortagwhich acts as the data Identifier and another key calledglobal_step. These keys are described here. If yourlogalready captures these values but as different key (saymodeformain_tagandepochforglobal_step), you can pass thetensorboard_key_mapargument (set as{mode: main_tag, epoch: global_step}). For more details, refer the documentation here.
Dev Setup
pip install -e ".[dev]"- Install pre-commit hooks
pre-commit install - The code is linted using:
blackflake8mypyisort
- Tests can be run locally using
nox
Acknowledgements
- Config for
circleci,pre-commit,mypyetc are borrowed/modified from Hydra
Release files for xplogger 0.11.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xplogger-0.11.3.tar.gz | 36.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xplogger-0.11.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 88.6 kB
Release files / xplogger-0.11.3.tar.gz
| Download URL | xplogger-0.11.3.tar.gz |
|---|---|
| Size | 36.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
46cf96b3c518a1d5c648f8f3df432cfba5b382c4c3d2fca5a467d9c241d78993
|
|
BLAKE2b-256 checksum How to use checksums |
e99671c363c35234b3c7ec9cbdb1664bf4b6e2766178fb7151a052611221be00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.12.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8
|
Release files / xplogger-0.11.3-py3-none-any.whl
| Download URL | xplogger-0.11.3-py3-none-any.whl |
|---|---|
| Size | 51.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c52c69a4de7a4abcda90862b3e0db8b9774f69705ccf598afe6242f621e39872
|
|
BLAKE2b-256 checksum How to use checksums |
953f9bd26326f141e54dff0c493272b933cd24933e1349653bedc4f45b265ea1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.12.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8
|