Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Record experiment data easily

Project description



pip install record_keeper

Easily add loggable information when you write a new function. First, create a list that contains the names of the attributes you want to record ("self.record_these" in the example below).

class YourNewLossFunction:
  def __init__(self, **kwargs):
    self.avg_embedding_norm = 0
    self.some_other_useful_stat = 0
    self.record_these = ["avg_embedding_norm", "some_other_useful_stat"]

  def compute_loss(self, embeddings, labels):
    self.avg_embedding_norm = torch.mean(torch.norm(embeddings, p=2, dim=1))
    self.some_other_useful_stat = some_cool_function(embeddings)

Then tell RecordKeeper the name of the list to read. RecordKeeper will then log and save all the attributes described in the list.

from torch.utils.tensorboard import SummaryWriter
import record_keeper as record_keeper_package

pickler_and_csver = record_keeper_package.PicklerAndCSVer(your_folder_for_logs)
tensorboard_writer = SummaryWriter(log_dir=your_tensorboard_folder)
record_keeper = record_keeper_package.RecordKeeper(tensorboard_writer, pickler_and_csver, ["record_these"])

# Then during training:
record_keeper.update_records(your_dict_of_objects, current_iteration)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for record-keeper, version 0.9.1
Filename, size File type Python version Upload date Hashes
Filename, size record_keeper-0.9.1-py3-none-any.whl (4.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size record_keeper-0.9.1.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page