Skip to main content

PyTorch model config and result tracker

Project description

Tool to track all PyTorch model config and architecture and prepare training summary reports

Usage Guide

The following will explain how to install the tool to your environment, and use the tool within a Jupyter Notebook

Installation

To install the tool simply run the following command in your terminal:

pip install --upgrade modeltest

Quick Start

To begin using the tool you must import the package into your notebook by adding the following:

import modeltrack.experiment as exp

After importing the experiment module you will be able to create a new tracker for your model:

tracker = exp.ModelTracker('model-name', config={"max_epochs":100})

When instantiating the new ModelTracker, you must pass in the name of the experiment being run as well as the model configuration. Optionally, you can pass a directory to root_dir to specify where the tracking output should be stored. The following configuration variables must be set, along with any other model-specific configuration:

config = {
   "batch_size": [INT],
   "learning_rate": [FLOAT],
   "max_epochs": [INT],
   "overwrite": [BOOL] - if set to True, most recent experiment with that name will be overwritten
}

The ModelTracker object has four functions that are useful during training:

  • tracker.start_training():

    Signal to the ModelTracker that a new training session has begun. Re-initializes parameter watchers
  • tracker.save_epoch_stats(train_loss, test_loss, train_acc, test_acc):

    Store the epoch statistics to be displayed and analyzed in output, and automatically log values
    train_loss:

    training loss of single epoch

    test_loss:

    training accuracy of single

    train_acc:

    testing/validation loss of single epoch

    test_acc:

    testing/validation accuracy of single epoch

  • tracker.save_model(model, epoch, optimizer, loss):

    Save the state of the model in a checkpoint file
    model:

    nn.Module object

    epoch:

    current epoch count

    optimizer:

    torch optimizer

    loss:

    current validation loss

  • tracker.finish_training(model=None):

    Save the training parameters for review and produce training report
    model:

    [Default=None] current nn.Module model being used at end of training

Examples

Please see demo_model.ipynb to see how the tool is used in a Jupyer Notebook or sample.py to see the tool used in a python script

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

modeltrack-1.0.2.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

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

modeltrack-1.0.2-py2.py3-none-any.whl (10.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file modeltrack-1.0.2.tar.gz.

File metadata

  • Download URL: modeltrack-1.0.2.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.10

File hashes

Hashes for modeltrack-1.0.2.tar.gz
Algorithm Hash digest
SHA256 06b03924f0d294c2841c4e5c43d2cb641eb78c33d310284c271f723ff5960d6a
MD5 813c5a4e639bd7fa4fa6341003c0a75f
BLAKE2b-256 75884c2792af9e86168ffae72ac059f43e4524e6b4d43382a1f3b1f3b77d65aa

See more details on using hashes here.

File details

Details for the file modeltrack-1.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: modeltrack-1.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.10

File hashes

Hashes for modeltrack-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 923152596954bae37d34ade436471f9cb4226982a022abb17ee15bf5657c4eee
MD5 cdc32e812f5e2d8098093a7ba9929539
BLAKE2b-256 26b364aa5d55950cafca5791876103245b834cdcc95a3aa12cbeb0968937740d

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