Skip to main content

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

  1. LambdaBS - sets the batch size to the base batch size times a given lambda.
  2. MultiplicativeBS - sets the batch size to the current batch size times a given lambda.
  3. StepBS - multiplies the batch size with a given factor at a given number of steps.
  4. MultiStepBS - multiplies the batch size with a given factor each time a milestone is reached.
  5. ConstantBS - multiplies the batch size by a given factor once and decreases it again to its base value after a given number of steps.
  6. LinearBS - increases the batch size by a linearly changing multiplicative factor for a given number of steps.
  7. ExponentialBS - increases the batch size by a given $\gamma$ each step.
  8. PolynomialBS - increases the batch size using a polynomial function in a given number of steps.
  9. CosineAnnealingBS - increases the batch size to a maximum batch size and decreases it again following a cyclic cosine curve.
  10. IncreaseBSOnPlateau - increases the batch size each time a given metric has stopped improving for a given number of steps.
  11. CyclicBS - cycles the batch size between two boundaries with a constant frequency, while also scaling the distance between boundaries.
  12. 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.
  13. 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.
  14. SequentialBS - calls a list of schedulers sequentially given a list of milestone points which reflect which scheduler should be called when.
  15. 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.

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.

Citation: TODO.

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.4.2.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

bs_scheduler-0.4.2-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file bs_scheduler-0.4.2.tar.gz.

File metadata

  • Download URL: bs_scheduler-0.4.2.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for bs_scheduler-0.4.2.tar.gz
Algorithm Hash digest
SHA256 2202923e3c778e61cf5adffbfd28738ce9242c9b5300775ca74e05ba30fee391
MD5 d9bd076695d997a890faf7c2f7e5cee4
BLAKE2b-256 963cee99819eea06947c59e2b076024bfcfe96d29e816d4e413daf2cc0b66546

See more details on using hashes here.

File details

Details for the file bs_scheduler-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bs_scheduler-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f5d21d4f633190b65a96c63837657419ee02024d6a1f9a299956bc519eb7d224
MD5 0b12e8bfd95576b1cd01a29219182e16
BLAKE2b-256 ad16ada09cd57957cccaa868b08a36099137c25162ef97b358fdf7ae6ab43fde

See more details on using hashes here.

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