ml-logger
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 "mllogger[all]"
If you want to use only the filesystem logger, use pip install "mllogger"
Install from source
git clone git@github.com:shagunsodhani/ml-logger.gitcd ml-loggerpip install ".[all]"
Alternatively, pip install "git+https://git@github.com/shagunsodhani/ml-logger.git@master#egg=ml_logger[all]"
If you want to use only the filesystem logger, use pip install . or pip install "git+https://git@github.com/shagunsodhani/ml-logger.git@master#egg=ml_logger".
Documentation
https://shagunsodhani.github.io/ml-logger
Use
-
Make a
logbook_config:from ml_logger import logbook as ml_logbook logbook_config = ml_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 = ml_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
Metadata
Release files for mllogger 0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mllogger-0.7.tar.gz | 19.4 kB | Without provenance | Details for mllogger-0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mllogger-0.7-py3-none-any.whl | Python 3 | none | any | Details for mllogger-0.7-py3-none-any.whl |
Total release size: 45.4 kB
Release files / mllogger-0.7.tar.gz
| Download URL | mllogger-0.7.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb384382bfa174a5f7cd003fbd78b297cb148e87c653614ff060b9616d343ce7
|
|
BLAKE2b-256 checksum How to use checksums |
2264fb0a7656898d769c2a21216eb07359e3e9feb0e499b5b4c183cb594d5e56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200917 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
|
Release files / mllogger-0.7-py3-none-any.whl
| Download URL | mllogger-0.7-py3-none-any.whl |
|---|---|
| Size | 26.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
43ea1fad6f63d25b076f8ae4981a43dd64be559cc3f1b85a4fcbc64f2bc135e8
|
|
BLAKE2b-256 checksum How to use checksums |
ba53c8fa17250d270fc9b625405c9484eb3b85632526e117f910f8ee9a7d25fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200917 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
|
Security for mllogger 0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.