A PyTorch Dataloader compatible batch size scheduler library.
Project description
bs_scheduler
A Batch Size Scheduler library compatible with PyTorch DataLoaders.
Documentation: API Reference.
Examples: TODO.
Why use a Batch Size Scheduler?
TODO: Cite papers and explain why.
Available Schedulers
Batch Size Schedulers
LambdaBS
- sets the batch size to the base batch size times a given lambda.MultiplicativeBS
- sets the batch size to the current batch size times a given lambda.StepBS
- multiplies the batch size with a given factor at a given number of steps.MultiStepBS
- multiplies the batch size with a given factor each time a milestone is reached.ConstantBS
- multiplies the batch size by a given factor once and decreases it again to its base value after a given number of steps.LinearBS
- increases the batch size by a linearly changing multiplicative factor for a given number of steps.ExponentialBS
- increases the batch size by a given $\gamma$ each step.PolynomialBS
- increases the batch size using a polynomial function in a given number of steps.CosineAnnealingBS
- increases the batch size to a maximum batch size and decreases it again following a cyclic cosine curve.IncreaseBSOnPlateau
- increases the batch size each time a given metric has stopped improving for a given number of steps.CyclicBS
- cycles the batch size between two boundaries with a constant frequency, while also scaling the distance between boundaries.CosineAnnealingBSWithWarmRestarts
- increases the batch size to a maximum batch size following a cosine curve, then restarts while also scaling the number of iterations until the next restart.OneCycleBS
- decreases the batch size to a minimum batch size then increases it to a given maximum batch size, following a linear or cosine annealing strategy.SequentialBS
- calls a list of schedulers sequentially given a list of milestone points which reflect which scheduler should be called when.ChainedBSScheduler
- chains a list of batch size schedulers and calls them together each step.
Quick Start
TODO.
Installation
Please install PyTorch first before installing this repository.
Cloning the repo and installing with pip:
git clone https://github.com/ancestor-mithril/bs_scheduler.git
cd bs_scheduler
pip3 install -e .
Or directly:
pip install git+https://github.com/ancestor-mithril/bs_scheduler.git@master
Licensing
The library is licensed under the BSD-3-Clause license.
Citation: TODO.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bs_scheduler-0.4.0.tar.gz
(25.6 kB
view hashes)
Built Distribution
Close
Hashes for bs_scheduler-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7d0c8875041e0696e0cf0bfb17f296ebf0a48a5a66a406614f8bc106b4a05e1 |
|
MD5 | 6be8e5e4eceb1a9099990ad155da37dd |
|
BLAKE2b-256 | dca9b53aa0461714c6ee3f2d41e6b67451afeb4072821094e1b0810f23f5b33a |