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
mlog plot epoch loss --aggregate median
mlog plot epoch loss --aggregate median --intervals max
mlog plot loss metric --scatter
Plotting
import mlog
import pandas as pd
import matplotlib.pyplot as plt
# 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.24.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.24.tar.gz.
File metadata
- Download URL: pymlog-0.0.24.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 |
d0ba29ca1255470934e0879ecb42e62f384cba9852dcc8bc736b663cec6d5121
|
|
| MD5 |
7df1b1bc77cd2a0f6f054f6791d15619
|
|
| BLAKE2b-256 |
8c1b0c81384341cefc7aff6c9f922ba52c5fc735d4541cbe557385f0dfc7ad83
|
File details
Details for the file pymlog-0.0.24-py3-none-any.whl.
File metadata
- Download URL: pymlog-0.0.24-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 |
c4c5bc45284894b239f1c540b5ba2be2658c31038ca418fa1d8ba43ba8b9b0d8
|
|
| MD5 |
967d418661df000b884f50c7fcd27390
|
|
| BLAKE2b-256 |
cfdef080c98c4f94b9e2ac54ddd7324d4f5181425339621dd465a393e792f467
|