adam-atan2-pytorch


Nameadam-atan2-pytorch JSON
Version 0.0.10 PyPI version JSON
download
home_pageNone
SummaryAdam-atan2 for Pytorch
upload_time2024-07-31 16:13:32
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2024 Phil Wang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords adam artificial intelligence deep learning optimizers
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="./adam-atan2.png" width="400px"></img>

## Adam-atan2 - Pytorch

Implementation of the proposed <a href="https://arxiv.org/abs/2407.05872">Adam-atan2</a> optimizer in Pytorch

A multi-million dollar paper out of google deepmind proposes a small change to Adam update rule (using `atan2`) to remove the epsilon altogether for numerical stability and scale invariance

## Install

```bash
$ pip install adam-atan2-pytorch
```

## Usage

```python
import torch
from torch import nn

# toy model

model = nn.Linear(10, 1)

# import AdamAtan2 and instantiate with parameters

from adam_atan2_pytorch import AdamAtan2

opt = AdamAtan2(model.parameters(), lr = 1e-4)

# forward and backwards

for _ in range(100):
  loss = model(torch.randn(10))
  loss.backward()

  # optimizer step

  opt.step()
  opt.zero_grad()
```

## Citations

```bibtex
@inproceedings{Everett2024ScalingEA,
    title   = {Scaling Exponents Across Parameterizations and Optimizers},
    author  = {Katie Everett and Lechao Xiao and Mitchell Wortsman and Alex Alemi and Roman Novak and Peter J. Liu and Izzeddin Gur and Jascha Narain Sohl-Dickstein and Leslie Pack Kaelbling and Jaehoon Lee and Jeffrey Pennington},
    year    = {2024},
    url     = {https://api.semanticscholar.org/CorpusID:271051056}
}
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "adam-atan2-pytorch",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "adam, artificial intelligence, deep learning, optimizers",
    "author": null,
    "author_email": "Phil Wang <lucidrains@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ed/76/6457daa098aaa4e31a814d6800452f5188f137afddf3a74ac6b00c6c2ef5/adam_atan2_pytorch-0.0.10.tar.gz",
    "platform": null,
    "description": "<img src=\"./adam-atan2.png\" width=\"400px\"></img>\n\n## Adam-atan2 - Pytorch\n\nImplementation of the proposed <a href=\"https://arxiv.org/abs/2407.05872\">Adam-atan2</a> optimizer in Pytorch\n\nA multi-million dollar paper out of google deepmind proposes a small change to Adam update rule (using `atan2`) to remove the epsilon altogether for numerical stability and scale invariance\n\n## Install\n\n```bash\n$ pip install adam-atan2-pytorch\n```\n\n## Usage\n\n```python\nimport torch\nfrom torch import nn\n\n# toy model\n\nmodel = nn.Linear(10, 1)\n\n# import AdamAtan2 and instantiate with parameters\n\nfrom adam_atan2_pytorch import AdamAtan2\n\nopt = AdamAtan2(model.parameters(), lr = 1e-4)\n\n# forward and backwards\n\nfor _ in range(100):\n  loss = model(torch.randn(10))\n  loss.backward()\n\n  # optimizer step\n\n  opt.step()\n  opt.zero_grad()\n```\n\n## Citations\n\n```bibtex\n@inproceedings{Everett2024ScalingEA,\n    title   = {Scaling Exponents Across Parameterizations and Optimizers},\n    author  = {Katie Everett and Lechao Xiao and Mitchell Wortsman and Alex Alemi and Roman Novak and Peter J. Liu and Izzeddin Gur and Jascha Narain Sohl-Dickstein and Leslie Pack Kaelbling and Jaehoon Lee and Jeffrey Pennington},\n    year    = {2024},\n    url     = {https://api.semanticscholar.org/CorpusID:271051056}\n}\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Phil Wang  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Adam-atan2 for Pytorch",
    "version": "0.0.10",
    "project_urls": {
        "Homepage": "https://pypi.org/project/adam_atan2_pytorch/",
        "Repository": "https://github.com/lucidrains/adam_atan2_pytorch"
    },
    "split_keywords": [
        "adam",
        " artificial intelligence",
        " deep learning",
        " optimizers"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cecb169e68dc7979e35bf2d696c9867658f7e34c3b073ee8b0a47a4d26dbf0c9",
                "md5": "36c232c712a5c982de3fffd3931cd67e",
                "sha256": "d1e3a4dd26f68b2506010d71285f5f7dd02f400140ca883b20376d3343d61103"
            },
            "downloads": -1,
            "filename": "adam_atan2_pytorch-0.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "36c232c712a5c982de3fffd3931cd67e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 6253,
            "upload_time": "2024-07-31T16:13:31",
            "upload_time_iso_8601": "2024-07-31T16:13:31.545167Z",
            "url": "https://files.pythonhosted.org/packages/ce/cb/169e68dc7979e35bf2d696c9867658f7e34c3b073ee8b0a47a4d26dbf0c9/adam_atan2_pytorch-0.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ed766457daa098aaa4e31a814d6800452f5188f137afddf3a74ac6b00c6c2ef5",
                "md5": "76069f969539957588e2ab286a83b1ac",
                "sha256": "09452956cc9d6f9fa7c7cc2fe5234070f995e0571b5e9fd2cc514a772160d987"
            },
            "downloads": -1,
            "filename": "adam_atan2_pytorch-0.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "76069f969539957588e2ab286a83b1ac",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 417990,
            "upload_time": "2024-07-31T16:13:32",
            "upload_time_iso_8601": "2024-07-31T16:13:32.838063Z",
            "url": "https://files.pythonhosted.org/packages/ed/76/6457daa098aaa4e31a814d6800452f5188f137afddf3a74ac6b00c6c2ef5/adam_atan2_pytorch-0.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-31 16:13:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lucidrains",
    "github_project": "adam_atan2_pytorch",
    "github_not_found": true,
    "lcname": "adam-atan2-pytorch"
}
        
Elapsed time: 1.33528s