Functions, losses, and module blocks to share between experiments.
Project description
Pugh Torch
Functions, losses, module blocks to share between experiments.
Package Features
- Additional methods to TensorBoard summary writer for adding normalized images and semantic segmentation images.
- hetero_cross_entropy for cross_entropy loss across heterogeneous datasets
- Convenient dataset downloading/unpacking to
~/.pugh_torch/datasets/
.- You can override this via the ENV variable
ROOT_DATASET_PATH
.
- You can override this via the ENV variable
Installation
Stable Release: pip install pugh_torch
Development Head: pip install git+https://github.com/BrianPugh/pugh_torch.git
Experiments
A big part of this repo is a framework to quickly be able to iterate on ideas.
To accomplish this, we provide the following:
- A docker container
brianpugh/pugh_torch
that contains many dependencies experimenters would like to use.- You can pull the docker image and launch the container via:
docker pull brianpugh/pugh_torch ./docker_run.sh
- This will map
~/.pugh_torch
and the local copy of the git repo into the container. You may change this if you like. This will also pass in any available GPUs and set other common docker flags for running/training neural nets. - This container runs a VNC server, incase you need to perform some visual
actions, like using
matplotlib.pyplot
- You can pull the docker image and launch the container via:
- A unified training driver
experiments/train.py
to run experiments.- From the
experiments/
folder, runpython3 train.py template
to begin training the default resnet50 architecture on ImageNet. - ImageNet cannot be automatically downloaded (see the error raised). To
get training started with an easier-to-obtain dataset, run:
python3 train.py template dataset=cifar100 model=cifar100
- From the
- A template project
experiments/template
that should get you going. The goal here is to provide maximum flexibility while minimizing "project startup costs". We leverage the following libraries:- Hydra for managing experiment hyperparameters and other configuration. It's a good idea to make your code configurable via this configuration rather than directly tweaking code to make experiments more trackable and reproduceable.
- PyTorch-Lightning for general project organization and training.
pugh_torch
for various tweaks and helpers that make using the above libraries easier for common projects and tasks.
Documentation
For full package documentation please visit BrianPugh.github.io/pugh_torch.
Free software: MIT license
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.4.0] - TBD
Added
- pytorch-lightning callbacks (TensorBoardAddSS, TensorBoardAddClassification) for add_ss and add_rgb for segmentation and classification tasks, respectively.
- Initial form of a project template to get ideas going quickly.
- ADE20K dataset
- various optimizers and getters
- various activation functions and getters
- LoadStateDictMixin that adds verbosity to model loading and has more laxed
strict
shape requirements. - pretrained resnet models (from torchvision) that utilize LoadStateDictMixin
- Label smoothing losses
[0.3.1] - 2020-09-21
Added
- Aliased
ResizeShortest
toShortestMaxSize
to be consistent withalbumentations.augmentations.transforms.LongestMaxSize
Fixed
- Add missing interpolation attribute in ResizeShortest transform.
- Fixed
ResizeShortest
producing erroenous results when both sides are the same length.
[0.3.0] - 2020-09-21
Added
- Text label adding to TensorBoard Images
- ResizeShortest augmentation transform
- Unit Testing utilities
- basic Datasets API
- A bunch of useful dependencies added.
[0.2.0] - 2020-09-15
Added
- Additional extra_requires in preparation for docker release.
[0.1.0] - 2020-09-13
Added
- Initial Release
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
File details
Details for the file pugh_torch-0.4.0.tar.gz
.
File metadata
- Download URL: pugh_torch-0.4.0.tar.gz
- Upload date:
- Size: 41.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c0f56fd6089a2641f737cb595974053067c750982360f9626ad5971751ca1c8 |
|
MD5 | 8aced481aea7a87e5e5e3e03bc9b6e84 |
|
BLAKE2b-256 | 9c2c3c6bbd16fac50e637b02b22ba174e6f85c2e028ab1e9d7f0c5f2c69d04e5 |
File details
Details for the file pugh_torch-0.4.0-py2.py3-none-any.whl
.
File metadata
- Download URL: pugh_torch-0.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 43.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eefc761a9169b4cac9f5f43784cdade6803c2358225158863994a6c66b0dd91e |
|
MD5 | bf3f5293067b9d78090df89341dd82a5 |
|
BLAKE2b-256 | a93a473ef71bfa15c5ea213abdd427795b6cf1ecf41d15727ba862e5b78eea20 |