A PyTorch Dataloader compatible batch size scheduler library.
Project description
bs-scheduler
A Batch Size Scheduler library compatible with PyTorch DataLoaders.
Documentation: API Reference.
Why use a Batch Size Scheduler?
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.
Installation
Please install PyTorch first before installing this repository.
pip install bs-scheduler
Or from git:
pip install git+https://github.com/ancestor-mithril/bs-scheduler.git@master
Licensing
The library is licensed under the BSD-3-Clause license.
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
bs_scheduler-0.5.0.tar.gz
(10.9 kB
view details)
Built Distribution
File details
Details for the file bs_scheduler-0.5.0.tar.gz
.
File metadata
- Download URL: bs_scheduler-0.5.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d705fb89532b980873c548f75ea4d789b56bd015c4a23ed1ca24d4affa2b3e47 |
|
MD5 | 76f1601088e473394a259b6e6e55621c |
|
BLAKE2b-256 | 716b83a80ea34adaf5f6b1b0fa8323e990ce75b2ad41a9aaa08db1797290d873 |
File details
Details for the file bs_scheduler-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: bs_scheduler-0.5.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30b2f96711188cf15c956f04f2f1d3c8754195a6afecf54164fa27d9137fba7d |
|
MD5 | 5930877312e2e310abb167138a929bcd |
|
BLAKE2b-256 | c4d6cd015fbd73a70085fb66ab067c068006dc0ab1a2105820cc670e18b68eea |