Skip to main content

Monitoring utility for machine learning experiments

Project description

Travis status for master branch codecov.io status for master branch https://img.shields.io/pypi/pyversions/rarog.svg

Rarog is a monitoring utility for machine learning experiments. You may use it as a light-weight alternative for TensorBoard or Visdom. Rarog stores all records in ClickHouse database using ClickHouse Python Driver.

Features

  • log common python data types(bool, int, float, string, iterables)

  • log 1d numpy arrays

  • distributed experiments monitoring

Setup

Install via pip:

pip install rarog

Start ClickHouse database if required:

docker run -d --name clickhouse --ulimit nofile=262144:262144 -p 9000:9000 yandex/clickhouse-server

Important note: the example above is just the easiest way. For production, you should setup database backups or replicated.

Rarog supports Python 3.4 and newer.

Usage

import random

from rarog import Tracker

tracker = Tracker(name='experiment_name')

# trace values one by one
for step in range(10):
    tracker.trace(
        name='int_value',
        value=random.randint(10, 20),
        step=step)
    tracker.trace(
        name='float_value',
        value=random.random(),
        step=step)
    # provide experiment phase as a string
    tracker.trace(
        name='list_value',
        value=[random.random(), random.random()],
        step=step,
        phase='val')

# trace values by dict
for step in range(10, 20):
    tracker.multy_trace({
        'int_value': random.randint(10, 20),
        'float_value': random.random()
    }, step=step)

# get names of traced metrics
tracker.metrics
# Out: ['time', 'step', 'phase', 'int_value', 'float_value', 'list_value']

If you are going to record more than 100 entries per second, it’s better to use sync_step or sync_seconds arguments. Thus writing to the database will be done with some period, which is much faster.

# `exist_ok` flag allow to use the same name for experiment
step_tracker = Tracker(name='experiment_name', sync_step=1000, exist_ok=True)

for step in range(20, 10**4):
    step_tracker.trace(name='bool_value', value=bool(random.randint(0, 1)), step=step)
    step_tracker.multy_trace({
        'int_value': random.randint(10, 20),
        'float_value': random.random()
    }, step=step)

# tracker should be manually synchronized after last entry
step_tracker.sync_accumulated_values()

Experiments can be handled via manager

from rarog import Manager

manager = Manager()
manager.list_experiments()
# Out: ['experiment_name']

manager.remove_experiment('experiment_name')

Retrieving your data

TODO (manually and with visualization)

TODO

  • Pytorch tensors support

  • Support 2d arrays

  • Tensorflow data types support

  • Split Aggregation View for summarization and underlying tables

  • Store experiments metadata(config, author, etc.)

  • Autodocs

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

rarog-0.1.dev1.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file rarog-0.1.dev1.tar.gz.

File metadata

  • Download URL: rarog-0.1.dev1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.3

File hashes

Hashes for rarog-0.1.dev1.tar.gz
Algorithm Hash digest
SHA256 71351edd1bd9391172fa86b36c64fab58f67df8e3d1e73940a449de6a24ea473
MD5 066c3b7b7ce00613c35b4900096cb46e
BLAKE2b-256 05b30e9e69a8aa471c236c4dc4f7db61d400cd218959972abb1f0cd0437df240

See more details on using hashes here.

Supported by

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