Skip to main content

Functions, losses, and module blocks to share between experiments.

Project description

Pugh Torch

Build Status Documentation Code Coverage

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.

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
  • A unified training driver experiments/train.py to run experiments.
    • From the experiments/ folder, run python3 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
  • 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 to ShortestMaxSize to be consistent with albumentations.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

pugh_torch-0.4.0.tar.gz (41.3 kB view hashes)

Uploaded Source

Built Distribution

pugh_torch-0.4.0-py2.py3-none-any.whl (43.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page