{"id":14971627,"url":"https://github.com/ancestor-mithril/bs-scheduler","last_synced_at":"2025-07-13T08:37:33.326Z","repository":{"id":195546350,"uuid":"693136883","full_name":"ancestor-mithril/bs-scheduler","owner":"ancestor-mithril","description":"A Batch Size Scheduler library compatible with PyTorch DataLoaders.","archived":false,"fork":false,"pushed_at":"2025-04-30T04:56:44.000Z","size":3283,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-26T15:09:32.527Z","etag":null,"topics":["batch-size","dataloaders","pytorch","scheduler"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ancestor-mithril.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-18T12:27:55.000Z","updated_at":"2025-04-30T04:56:47.000Z","dependencies_parsed_at":"2023-11-02T09:35:24.444Z","dependency_job_id":"95badea3-f9df-425b-85ca-427f78a816c7","html_url":"https://github.com/ancestor-mithril/bs-scheduler","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":0.35,"last_synced_commit":"f4780038ed52020636aa558d4b3ea857f0ea7dd7"},"previous_names":["ancestor-mithril/bs_scheduler","ancestor-mithril/bs-scheduler"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/ancestor-mithril/bs-scheduler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancestor-mithril%2Fbs-scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancestor-mithril%2Fbs-scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancestor-mithril%2Fbs-scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancestor-mithril%2Fbs-scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ancestor-mithril","download_url":"https://codeload.github.com/ancestor-mithril/bs-scheduler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancestor-mithril%2Fbs-scheduler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262289755,"owners_count":23288123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batch-size","dataloaders","pytorch","scheduler"],"created_at":"2024-09-24T13:45:34.469Z","updated_at":"2025-07-13T08:37:33.317Z","avatar_url":"https://github.com/ancestor-mithril.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bs-scheduler\n\nA Batch Size Scheduler library compatible with PyTorch DataLoaders.\n\n*** \n\n## Documentation\n\n* [API Reference](https://ancestor-mithril.github.io/bs-scheduler).\n\n* [Examples](https://ancestor-mithril.github.io/bs-scheduler/tutorials).\n\n\u003c!--For Release Notes, see TODO. --\u003e\n\n***\n\n## Why use a Batch Size Scheduler?\n\n* Using a big batch size has several advantages:\n  * Better hardware utilization.\n  * Enhanced parallelism.\n  * Faster training.\n* However, using a big batch size from the start may lead to a generalization gap.\n* Therefore, the solution is to gradually increase the batch size, similar to a learning rate decay policy.\n* See [Don't Decay the Learning Rate, Increase the Batch Size](https://arxiv.org/abs/1711.00489).\n* See [bs-scheduler: A Batch Size Scheduler library compatible with PyTorch DataLoaders](https://www.sciencedirect.com/science/article/pii/S2352711025001293)\n\n\n## Available Schedulers\n\n### Batch Size Schedulers\n\n1. `LambdaBS` - sets the batch size to the base batch size times a given lambda.\n2. `MultiplicativeBS` - sets the batch size to the current batch size times a given lambda.\n3. `StepBS` - multiplies the batch size with a given factor at a given number of steps.\n4. `MultiStepBS` - multiplies the batch size with a given factor each time a milestone is reached.\n5. `ConstantBS` - multiplies the batch size by a given factor once and decreases it again to its base value after a\n   given number of steps.\n6. `LinearBS` - increases the batch size by a linearly changing multiplicative factor for a given number of steps.\n7. `ExponentialBS` - increases the batch size by a given $\\gamma$ each step.\n8. `PolynomialBS` - increases the batch size using a polynomial function in a given number of steps.\n9. `CosineAnnealingBS` - increases the batch size to a maximum batch size and decreases it again following a cyclic\n   cosine curve.\n10. `IncreaseBSOnPlateau` - increases the batch size each time a given metric has stopped improving for a given number\n    of steps.\n11. `CyclicBS` - cycles the batch size between two boundaries with a constant frequency, while also scaling the\n    distance between boundaries.\n12. `CosineAnnealingBSWithWarmRestarts` - increases the batch size to a maximum batch size following a cosine curve,\n    then restarts while also scaling the number of iterations until the next restart.\n13. `OneCycleBS` - decreases the batch size to a minimum batch size then increases it to a given maximum batch size,\n    following a linear or cosine annealing strategy.\n14. `SequentialBS` - calls a list of schedulers sequentially given a list of milestone points which reflect which\n    scheduler should be called when.\n15. `ChainedBSScheduler` - chains a list of batch size schedulers and calls them together each step.\n\n\u003c!--\n\n## Quick Start\n\nTODO.\n\n--\u003e\n\n## Installation\n\nPlease install [PyTorch](https://github.com/pytorch/pytorch) first before installing this repository.\n\n```\npip install bs-scheduler\n```\n\n## Licensing\n\nThe library is licensed under the [BSD-3-Clause license](LICENSE).\n\n## Citation\n\n```\n@article{stoica2025,\n  title = {bs-scheduler: A Batch Size Scheduler library compatible with PyTorch DataLoaders},\n  journal = {SoftwareX},\n  volume = {30},\n  pages = {102162},\n  year = {2025},\n  issn = {2352-7110},\n  doi = {https://doi.org/10.1016/j.softx.2025.102162},\n  url = {https://www.sciencedirect.com/science/article/pii/S2352711025001293},\n  author = {George Stoica and Mihaela Elena Breabăn}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fancestor-mithril%2Fbs-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fancestor-mithril%2Fbs-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fancestor-mithril%2Fbs-scheduler/lists"}