Skip to main content

DLTrainer is an easy to use framework for quickly setting up deep learning experiments. This includes CPU, single GPU and distributed GPU experiments. Currently, this package only supports PyTorch. This packages is primarily designed for running experiments from the command line, so that workloads can be easily ran in the cloud.

Project description

Introduction

DLTrainer is an easy to use framework for quickly setting up deep learning experiments. This includes CPU, single GPU and distributed GPU experiments. Currently, this package only supports PyTorch.

This packages is primarily designed for running experiments from the command line, so that workloads can be easily ran in the cloud.

Installation

pip install DLTrainer

Usage

You can get started running your experiment with the following setup. This is just a short overview, the examples folder can be used for an example of an actual setup.

An example folder structure is shown below. It is fine to deviate from this structure, however, you will need to ensure your run.py file can import your custom models, datasets and metrics. Additionally, you can put your data folder anywhere so long as your set the --data_dir argument correctly. You must specify how to load your data in your custom Dataset class, therefore, you may name these files however you like.

  ├── your_project
      ├── your_data
          ├──train.pkl      # your training set
          ├──dev.pkl        # your dev set
      ├── model.py        # your custom model class
      ├── dataset.py      # your custom dataset specific to your task (see https://pytorch.org/tutorials/beginner/basics/data_tutorial.html) for more details
      ├── metrics.py      # functions to calculate your task specific metrics
      ├── run.py  

A quick example of run.py using the above file structure.

from DLTrainer.pytorch import DLTrainer

# custom file imports
from model import your_config_class, your_model_class
from dataset import your_dataset_class
from metrics import your_metrics_func

MODELS = {
    'my_model': (your_config_class, your_model_class, your_dataset_class),
}

if __name__ == "__main__":
    trainer = DLTrainer(MODELS, metrics_fn=calculate_metrics)

The following command will execture training using this script for 1 training epoch.

python run.py --model my_model --data_dir data --run-name sample_run --do_train --num_train_epochs 1

To see a see a full list of DLTrainer input arguments run:

python run.py --help

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

DLTrainer-0.0.2.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

DLTrainer-0.0.2-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file DLTrainer-0.0.2.tar.gz.

File metadata

  • Download URL: DLTrainer-0.0.2.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for DLTrainer-0.0.2.tar.gz
Algorithm Hash digest
SHA256 df1b573641d8ed45ad970b82a5c52453a28fdfd0f22468cfc29157e3a29b5b5e
MD5 92226f921c065b4d426a8de6b25a2102
BLAKE2b-256 f74328bbc5993623e017439c2c2cc8f87ff2f0e8eadb4bc6e008086cc24b1df5

See more details on using hashes here.

File details

Details for the file DLTrainer-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: DLTrainer-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for DLTrainer-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 80c09f59ffa79fcf03ac9debcdf6266b975c6a7f1723d4aaf940c4973e4e72e6
MD5 d69baeff61d45df9eaf50a23a459aefd
BLAKE2b-256 69dd8c7ce9f9b3e7f3c09b63d2dfcb0ad31fe016172292e784fe9984d9b4b6e1

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