Giter Club home page Giter Club logo

explog's Introduction

Exp Log - A Minimal Experiment Logger

Installation

pip install explog

Then, import explog as xl.

Logging

Use exp = xl.exp(config) to initialize an experiment and exp.log(...) to log statistics.

import explog as xl
import random

config = {'num_epochs': 100, 'learning_rate': 1e-3, 'batch_size': 32}

exp = xl.exp(config)

for epoch in range(config['num_epochs']):
    loss = random.random() * 1.05 ** (- epoch)
    exp.log(epoch=epoch, loss=loss)
  • NB: Using xl.log(...) instead of exp.log(...) automatically logs to the latest experiment.
  • NB: Both xl.exp(...) and xl.log(...) accept dictionary or kwargs arguments.

Exploring runs

Retrieve dataframe of experiments using xl.exps().

> xl.exps()
          num_epochs  learning_rate  batch_size
_id
w1gf6deg         100          0.001          32
6mwn9cno         100          0.001          32
hdakmy0l         100          0.001          32

Exploring logs

Retrieve dataframe of logs using xl.logs().

> xl.logs()
                epoch      loss  num_epochs  learning_rate  batch_size
_id      _step
w1gf6deg 0          0  0.901695         100          0.001          32
         1          1  0.676328         100          0.001          32
         2          2  0.194963         100          0.001          32
         3          3  0.345743         100          0.001          32
         4          4  0.645544         100          0.001          32
...               ...       ...         ...            ...         ...
hdakmy0l 95        95  0.003342         100          0.001          32
         96        96  0.000132         100          0.001          32
         97        97  0.003763         100          0.001          32
         98        98  0.008314         100          0.001          32
         99        99  0.004589         100          0.001          32

Plotting

Use dataframe of logs from xl.logs() to make your plots.

import explog as xl
import matplotlib.pyplot as plt

logs = xl.logs('epoch', 'loss')
logs = logs.groupby('epoch').mean()

plt.plot(logs.index, logs['loss'])
plt.show()

Weights & Biases users

Use aliases run = xl.init(config) for exp = xl.exp(config) and xl.runs for xl.exps.

> run = xl.init(config)
> run.log(step=0)
> xl.runs()
          num_epochs  learning_rate  batch_size
_id
z5y6tdm5         100          0.001          32

explog's People

Contributors

glambrechts avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.