Skip to main content

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


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.22.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymlog-0.0.22-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file pymlog-0.0.22.tar.gz.

File metadata

  • Download URL: pymlog-0.0.22.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

Hashes for pymlog-0.0.22.tar.gz
Algorithm Hash digest
SHA256 de1fd84ac323092c36da66d1d3fb0a582aef9240857843091d7f41e0aa2a947f
MD5 19e1fd4549cba95919d0920d2e9af820
BLAKE2b-256 3ad7d7dd4018a5ec4bfe02a93f91ec64be13e9221b94ed5601945bafcf5b4af1

See more details on using hashes here.

File details

Details for the file pymlog-0.0.22-py3-none-any.whl.

File metadata

  • Download URL: pymlog-0.0.22-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

Hashes for pymlog-0.0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 c2adc279de06f7f7f7abf2bd59ff0966cb6f494502fa5014b512e3ade4d98d1a
MD5 df31525258c0a1d1ff6cc6fe83e035c6
BLAKE2b-256 89bdafb114e1811722d928dd92529f5647be6ad87842a9e938a1554a15f37e80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page