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
checkpointsdirectory.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c978190d0418677dd8695e5c6b3b580a6b2cca75b122018dfcc835c5a36590a8
|
|
| MD5 |
a769909722f6e3763bfbf2775ab1b71e
|
|
| BLAKE2b-256 |
3a0dd04423c689d4ad0305da6d426d5be3f3b0831af335fb7f753e3eaedc0c58
|
Provenance
The following attestation bundles were made for epoch_engine-0.1.0.tar.gz:
Publisher:
publish.yml on spolivin/epoch-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epoch_engine-0.1.0.tar.gz -
Subject digest:
c978190d0418677dd8695e5c6b3b580a6b2cca75b122018dfcc835c5a36590a8 - Sigstore transparency entry: 347648005
- Sigstore integration time:
-
Permalink:
spolivin/epoch-engine@67357a8d869604f5c30e4bac3a1ec6cb3c9f9948 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/spolivin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@67357a8d869604f5c30e4bac3a1ec6cb3c9f9948 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdcd1b2d367618efc964b5daa59f008e23d134ed061071945063623a977b9756
|
|
| MD5 |
8cb1be9abc42f5bae4a0f1fd34c5538a
|
|
| BLAKE2b-256 |
7374490bd99cbaeb103cbe0fecb0bd992e5dc929147ed3944abea3d0b0c50adc
|
Provenance
The following attestation bundles were made for epoch_engine-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on spolivin/epoch-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epoch_engine-0.1.0-py3-none-any.whl -
Subject digest:
cdcd1b2d367618efc964b5daa59f008e23d134ed061071945063623a977b9756 - Sigstore transparency entry: 347648013
- Sigstore integration time:
-
Permalink:
spolivin/epoch-engine@67357a8d869604f5c30e4bac3a1ec6cb3c9f9948 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/spolivin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@67357a8d869604f5c30e4bac3a1ec6cb3c9f9948 -
Trigger Event:
release
-
Statement type: