Skip to main content

Experiment tracking module

Project description

track

Installation

pip install track (Not yet). Until we get pypi set up (there's another track package...), use

pip install --upgrade git+https://github.com/richardliaw/track.git@master#egg=track

Usage

Report various metrics of interest, with automatically configured and persisted logging.

import track 

def training_function(param1=0.01, param2=10):
    local = "~/track/myproject"
    remote = "s3://my-track-bucket/myproject"
    with track.trial(local, remote, param_map={"param1": param1, "param2": param2}):
        model = create_model()
        for epoch in range(100):
            model.train()
            loss = model.get_loss()
            track.metric(iteration=epoch, loss=loss)
            track.debug("epoch {} just finished with loss {}", epoch, loss)
            model.save(os.path.join(track.trial_dir(), "model{}.ckpt".format(epoch)))

Inspect existing experiments

$ python -m track.trials --local_dir ~/track/myproject trial_id "start_time>2018-06-28" param2
trial_id    start_time                param2
8424fb387a 2018-06-28 11:17:28.752259 10

Plot results

import track
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

proj = track.Project("~/track/myproject", "s3://my-track-bucket/myproject")
most_recent = proj.ids["start_time"].idxmax()
most_recent_id = proj.ids["trial_id"].iloc[[most_recent]]
res = proj.results(most_recent_id)
plt.plot(res[["iteration", "loss"]].dropna())
plt.savefig("loss.png")

Recover saved artifacts

model.load(proj.fetch_artifact(most_recent_id[0], 'model10.ckpt'))
model.serve_predictions()

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

track-ml-0.1.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

track_ml-0.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file track-ml-0.1.tar.gz.

File metadata

  • Download URL: track-ml-0.1.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.6

File hashes

Hashes for track-ml-0.1.tar.gz
Algorithm Hash digest
SHA256 b14422cc48b30dda6de69429d7a33421615f8d3c29d07073608946cb0ad3873b
MD5 c17724dd17dffd7a7fa59d1627711ddf
BLAKE2b-256 54e41c971b135c96e58b6721d4b1e586888f82833161f4311b0c65261ba6fde2

See more details on using hashes here.

File details

Details for the file track_ml-0.1-py3-none-any.whl.

File metadata

  • Download URL: track_ml-0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.6

File hashes

Hashes for track_ml-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d4adb88aabc3f914c093e813b21d72b3b77220eed6794f911cc4895a81f05f86
MD5 1f5215dbbbbefb73539531108a806694
BLAKE2b-256 76d7d402da7755d589f6183a71af8fa239feacf094f1ea905e9a2cf9e4d45568

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