bs-scheduler


Namebs-scheduler JSON
Version 0.4.0 PyPI version JSON
download
home_pageNone
SummaryA PyTorch Dataloader compatible batch size scheduler library.
upload_time2024-04-29 09:29:40
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseBSD 3-Clause License Copyright (c) 2023, ancestor-mithril Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords deep learning pytorch batch size scheduler dynamic batch size
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # bs_scheduler

A Batch Size Scheduler library compatible with PyTorch DataLoaders.

*** 

Documentation: [API Reference](https://ancestor-mithril.github.io/bs_scheduler/).

Examples: TODO.

<!--For Release Notes, see 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](https://github.com/pytorch/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](LICENSE).

Citation: TODO.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "bs-scheduler",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "George Stoica <george.stoica@senticlab.com>",
    "keywords": "deep learning, pytorch, batch size scheduler, dynamic batch size",
    "author": null,
    "author_email": "George Stoica <george.stoica@senticlab.com>",
    "download_url": "https://files.pythonhosted.org/packages/4e/59/6d99f07545514a059e6140c0abdfc829786dd0c9a4bf3ba43879fa6fbc76/bs_scheduler-0.4.0.tar.gz",
    "platform": null,
    "description": "# bs_scheduler\n\nA Batch Size Scheduler library compatible with PyTorch DataLoaders.\n\n*** \n\nDocumentation: [API Reference](https://ancestor-mithril.github.io/bs_scheduler/).\n\nExamples: TODO.\n\n<!--For Release Notes, see TODO. -->\n\n## Why use a Batch Size Scheduler?\n\nTODO: Cite papers and explain why.\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## Quick Start\n\nTODO.\n\n## Installation\n\nPlease install [PyTorch](https://github.com/pytorch/pytorch) first before installing this repository.\n\nCloning the repo and installing with pip:\n\n```\ngit clone https://github.com/ancestor-mithril/bs_scheduler.git\ncd bs_scheduler\npip3 install -e .\n```\n\nOr directly:\n\n```\npip install git+https://github.com/ancestor-mithril/bs_scheduler.git@master\n```\n\n## Licensing\n\nThe library is licensed under the [BSD-3-Clause license](LICENSE).\n\nCitation: TODO.\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2023, ancestor-mithril  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "A PyTorch Dataloader compatible batch size scheduler library.",
    "version": "0.4.0",
    "project_urls": {
        "repository": "https://github.com/ancestor-mithril/bs_scheduler"
    },
    "split_keywords": [
        "deep learning",
        " pytorch",
        " batch size scheduler",
        " dynamic batch size"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dca9b53aa0461714c6ee3f2d41e6b67451afeb4072821094e1b0810f23f5b33a",
                "md5": "6be8e5e4eceb1a9099990ad155da37dd",
                "sha256": "f7d0c8875041e0696e0cf0bfb17f296ebf0a48a5a66a406614f8bc106b4a05e1"
            },
            "downloads": -1,
            "filename": "bs_scheduler-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6be8e5e4eceb1a9099990ad155da37dd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 17606,
            "upload_time": "2024-04-29T09:29:38",
            "upload_time_iso_8601": "2024-04-29T09:29:38.990672Z",
            "url": "https://files.pythonhosted.org/packages/dc/a9/b53aa0461714c6ee3f2d41e6b67451afeb4072821094e1b0810f23f5b33a/bs_scheduler-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4e596d99f07545514a059e6140c0abdfc829786dd0c9a4bf3ba43879fa6fbc76",
                "md5": "6adb497df23bacf0e7e37d5fb3a07966",
                "sha256": "2d3dc9977b73a62aa2e3fe21b9b2a2425775bd6361dd54a44b5b889348cdebb1"
            },
            "downloads": -1,
            "filename": "bs_scheduler-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6adb497df23bacf0e7e37d5fb3a07966",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 25606,
            "upload_time": "2024-04-29T09:29:40",
            "upload_time_iso_8601": "2024-04-29T09:29:40.340586Z",
            "url": "https://files.pythonhosted.org/packages/4e/59/6d99f07545514a059e6140c0abdfc829786dd0c9a4bf3ba43879fa6fbc76/bs_scheduler-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-29 09:29:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ancestor-mithril",
    "github_project": "bs_scheduler",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "bs-scheduler"
}
        
Elapsed time: 0.26372s