Skip to main content

Trainer and evaluator for PyTorch models with a focus on simplicity and flexibility.

Project description

Epoch Engine - Python Library for training PyTorch models

This project represents my attempt to come up with a convenient way to train neural nets coded in Torch. While being aware of already existing libraries for training PyTorch models (e.g. PyTorch Lightning), my idea here is to make training of the models more visual and understandable as to what is going on during training.

The project is currently in its raw form, more changes expected.

Features

  • TQDM-Progress bar support for both training and validation loops
  • Intemediate metrics computations after each forward pass (currently it is based on computing loss and accuracy only)
  • Saving/loading checkpoints from/into Trainer directly without having to touch model, optimizer or scheduler separately
  • Resuming training from the loaded checkpoint with epoch number being remembered automatically to avoid having to remember from which epoch the training originally started
  • Ready-to-use neural net architectures coded from scratch (currently only 4-layer Encoder-Decoder and ResNet with 20 layers architectures are available)

Installation

After cloning this repo, the package can be installed in the development mode as follows:

# Installing the main package
pip install -e .

# Installing additional optional dependencies
pip install -e .[build,linters]

Python API

The basics of the developed API are presented in the test script I built. It can be run for instance as follows:

python run_trainer.py --model=resnet --epochs=3 --batch-size=16

The training will be launched on the device automatically derived based on the CUDA availability and the final training checkpoint will be saved in checkpoints directory.

One can also resume the training from the saved checkpoint:

python run_trainer.py --model=resnet --epochs=4 --resume-training=True --ckpt-path=checkpoints/ckpt_3.pt

The training will be resumed from the loaded checkpoint with TQDM-progress bar showing the next training epoch.

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

epoch_engine-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

epoch_engine-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file epoch_engine-0.1.0.tar.gz.

File metadata

  • Download URL: epoch_engine-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for epoch_engine-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c978190d0418677dd8695e5c6b3b580a6b2cca75b122018dfcc835c5a36590a8
MD5 a769909722f6e3763bfbf2775ab1b71e
BLAKE2b-256 3a0dd04423c689d4ad0305da6d426d5be3f3b0831af335fb7f753e3eaedc0c58

See more details on using hashes here.

Provenance

The following attestation bundles were made for epoch_engine-0.1.0.tar.gz:

Publisher: publish.yml on spolivin/epoch-engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file epoch_engine-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: epoch_engine-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for epoch_engine-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cdcd1b2d367618efc964b5daa59f008e23d134ed061071945063623a977b9756
MD5 8cb1be9abc42f5bae4a0f1fd34c5538a
BLAKE2b-256 7374490bd99cbaeb103cbe0fecb0bd992e5dc929147ed3944abea3d0b0c50adc

See more details on using hashes here.

Provenance

The following attestation bundles were made for epoch_engine-0.1.0-py3-none-any.whl:

Publisher: publish.yml on spolivin/epoch-engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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