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.23.tar.gz
(4.8 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.23.tar.gz.
File metadata
- Download URL: pymlog-0.0.23.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f93c6a7d39622c1df4deaa7d012ec98536ca97ad146a8c5e91c2baa323e03a9
|
|
| MD5 |
4ba6df25d02306a16f3af4311c9b8552
|
|
| BLAKE2b-256 |
25eb52a2bcd1ea3455605aeee6e50bb3ce0c6cfc7d7a31fe89e09667eea15d7f
|
File details
Details for the file pymlog-0.0.23-py3-none-any.whl.
File metadata
- Download URL: pymlog-0.0.23-py3-none-any.whl
- Upload date:
- Size: 6.0 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 |
da38de2118fa325aaf603896ddd22163c25057bffcc380c2c89826cbbefcbc39
|
|
| MD5 |
f3df1242bf2b1a610f4cada62a5b8db6
|
|
| BLAKE2b-256 |
e7a9ae8d419757c0c1693a3abcac781bbc8b44ef119f1db087a819bd2b909913
|