A minimal logging utility for machine learning experiments
Project description
MLog
A minimal logging utility for machine learning experiments.
Installation
pip install pymlog
Logging
import mlog
import random
CONFIG = {'num_epochs': 100}
# Create a new run with an associated configuration
run = mlog.start(run='run_name', config=CONFIG, save='train.py')
# Log seamlessly
for epoch in range(CONFIG['num_epochs']):
loss = random.random() * (1.05 ** (- epoch))
run.log(epoch=epoch, loss=loss)
metric = random.random()
run.log(epoch=epoch, metric=metric)
Quick preview
mlog plot epoch loss --group
mlog plot epoch loss --group --aggregate median
mlog plot epoch loss --group --aggregate median --intervals max
mlog plot loss metric --scatter
Plotting
import matplotlib.pyplot as plt
import pandas as pd
# Retrieve data
df = mlog.get('epoch', 'loss')
df = df.groupby('epoch').aggregate(['mean', 'min', 'max'])
# Plot data
fig, ax = plt.subplots()
ax.plot(df.index, df.loss['mean'])
ax.fill_between(df.index, df.loss['min'], df.loss['max'], alpha=0.4)
plt.show()
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
pymlog-0.0.19.tar.gz
(4.9 kB
view details)
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 pymlog-0.0.19.tar.gz.
File metadata
- Download URL: pymlog-0.0.19.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2efb3d24060cb4b9fcf06442c3b0e802689044849c1d90547e63b129f366381
|
|
| MD5 |
0cfc88a1ddeeb356b6b89de8f6cd19cc
|
|
| BLAKE2b-256 |
868ee79e7ad8ad1a7cf03d0d722425ea86dfd5ff1bb8bfa299e5107fb1aa8ef8
|
File details
Details for the file pymlog-0.0.19-py3-none-any.whl.
File metadata
- Download URL: pymlog-0.0.19-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79909f9c79fc0952b4604a3062d035853facb0ea0035903388a159e14d27a07f
|
|
| MD5 |
2b452992091ec5be40ca21780786a907
|
|
| BLAKE2b-256 |
8b2352130d969840154395056dd46fa4731ec3c07922d093ffd002416b73293e
|