step-back

Deep Learning optimization experiments in Pytorch

https://github.com/fabian-sp/step-back

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.6%) to scientific vocabulary

Keywords

benchmark deep-learning optimization pytorch
Last synced: 7 months ago · JSON representation

Repository

Deep Learning optimization experiments in Pytorch

Basic Info
  • Host: GitHub
  • Owner: fabian-sp
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 155 MB
Statistics
  • Stars: 7
  • Watchers: 3
  • Forks: 3
  • Open Issues: 0
  • Releases: 0
Topics
benchmark deep-learning optimization pytorch
Created over 3 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

README.md

Step-back logo


This package is intended for running and benchmarking optimization algorithms in Pytorch. It could be used for

  • retrieving training curves for standard methods (SGD, Adam) on standard benchmark problems (e.g. training a ResNet on CIFAR10/100),
  • testing and benchmarking new optimization algorithms

Getting started

Install via

python setup.py

or in order to install in developer mode via

python -m pip install --editable .

Results

Currently, the repo implements some standard image classification architectures (ResNet, VGG, ViT) and datasets (MNIST, CIFAR, Imagenet). It also contains a toy language model training setup (character-level Shakespeare dataset).

Below is an overview of experiments for which we provide the code that generated the results (i.e. the model, dataset preprocessing and training setup) as well as the actual scores at the end of each epoch. An overview and all links are given in the table below.

| ID | Model | Dataset | Results |
|-----|--------|----------|----------| | cifar100resnet110 | ResNet110 code | Cifar100 code | record |
| cifar10
resnet20 | ResNet20 code | Cifar10 code | record |
| cifar10vgg16 | VGG16 code | Cifar10 code | record |
| cifar10
vit | Small ViT code | Cifar10 code | record | | imagenet32resnet18 | ResNet18 code | Imagenet32 code | record |
| mnist
mlp | MLP (3-layer, ReLU) code | MNIST code | record |

For each experiment, the exact config can also be found under configs/ where the files are named according to the ID (and possibly an integer suffix).

How to use

The main runner functions are run.py (or run.ipynb if you prefer notebooks). Any experiment needs a config file, see e.g. configs/test.json. In general, the name of the config file serves as experiment ID; it is used later for storing the output, plotting etc.

There are two ways of specifying a config for run.py.

1) dict-type configs

  • Here, the config JSON is a dictionary where you can specify at each key a list or a single entry.
  • The same is true for the hyperparameters of each entry in the opt key of the config file.
  • A cartesian product of all lists entrys will be run (ie. potentially many single training runs in sequence).
  • Multiple repetitions can be done using the key n_runs. This will use different seeds for shuffling the DataLoader.

2) list-type configs

  • The config JSON is a list, where each entry is a config for a single training run.
  • This format is intended only when you want to launch multiple runs in parallel. You should first create a dict-type config, and then use utilities for creating temporary list-type configs (see an example here).

You can run an experiment with run.py or with run.ipynb. A minimal example is:

python run.py -i 'test' Run python run.py --help in the terminal for detailed options.

Once you launch experiments, the output is stored as JSON in output if no other directory is specified.

Output structure

Every single run stores output as a dictionary in the following way:

{'config': configuration of the experiment 'history': list of dictionary (one per epoch), see key names below 'summary': useful information such as start time and end time }

For the entries in history, the following keys are important:

  • learning_rate: the learning rate value in that epoch. This is different to the lr key in config['opt'] if learning rate schedule is used.
  • train_loss: loss function value over training set
  • val_loss: loss function value over validation set
  • train_score: score function (eg accuracy) over training set
  • val_score: score function (eg accuracy) over validation set

In stepback.utils.py you can find several helper functions for merging or filtering output files.

Owner

  • Login: fabian-sp
  • Kind: user
  • Location: Munich
  • Company: TUM

:bulb: Optimization :coffee: Machine Learning

GitHub Events

Total
  • Watch event: 1
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 7
  • Pull request event: 1
  • Fork event: 1
  • Create event: 3
Last Year
  • Watch event: 1
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 7
  • Pull request event: 1
  • Fork event: 1
  • Create event: 3

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 1
  • Total pull requests: 35
  • Average time to close issues: 6 days
  • Average time to close pull requests: 15 days
  • Total issue authors: 1
  • Total pull request authors: 3
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.74
  • Merged pull requests: 30
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 5
  • Average time to close issues: N/A
  • Average time to close pull requests: 5 days
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • gowerrobert (1)
Pull Request Authors
  • fabian-sp (32)
  • eickenberg (5)
  • gowerrobert (1)
Top Labels
Issue Labels
Pull Request Labels
draft (1)