torchtoolkit


Nametorchtoolkit JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/Natooz/TorchToolkit
SummaryUseful functions to use with PyTorch
upload_time2022-12-10 10:33:55
maintainer
docs_urlNone
authorNathan Fradet
requires_python
licenseMIT
keywords artificial intelligence deep learning transformer nlp
VCS
bugtrack_url
requirements torch numpy tqdm
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TorchToolkit

[![PyPI version fury.io](https://badge.fury.io/py/torchtoolkit.svg)](https://pypi.python.org/pypi/torchtoolkit/)
[![GitHub workflow](https://img.shields.io/github/workflow/status/Natooz/MidiTok/Testing)](https://github.com/Natooz/TorchToolkit/actions)
[![GitHub license](https://img.shields.io/github/license/Natooz/MidiTok.svg)](https://github.com/Natooz/TorchToolkit/blob/main/LICENSE)

Hi 👋, this is a small Python package containing useful functions to use with PyTorch.
It includes [utilities](torchtoolkit/utils.py), [metrics](torchtoolkit/metrics.py) and [sampling](torchtoolkit/sampling.py) methods to use during and after training a model.

Feel free to use it, take the code for your projects, and raise an issue if you have question or a pull request if you want to contribute.

```shell
pip install torchtoolkit
```
It requires Python 3.8 or above.

Simplest example:

```python
from torchtoolkit.metrics import Accuracy
from torch import randint, randn
from pathlib import Path

acc = Accuracy(mode='top_k', top_kp=5)
for _ in range(10):
    res = randn((16, 32))
    expected = randint(0, 32, (16, ))
    acc(res, expected)  # saving results
acc.save(Path('path', 'to', 'save', 'file.csv'))
acc.analyze()
```

I built it for my own usage, so you won't find documentation besides the docstring.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Natooz/TorchToolkit",
    "name": "torchtoolkit",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "artificial intelligence,deep learning,transformer,nlp",
    "author": "Nathan Fradet",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/d8/15/d58824cb66c1c34840b83e464db40c960ae58aa16f25f2a45ecf7a98de4e/torchtoolkit-0.0.4.tar.gz",
    "platform": null,
    "description": "# TorchToolkit\n\n[![PyPI version fury.io](https://badge.fury.io/py/torchtoolkit.svg)](https://pypi.python.org/pypi/torchtoolkit/)\n[![GitHub workflow](https://img.shields.io/github/workflow/status/Natooz/MidiTok/Testing)](https://github.com/Natooz/TorchToolkit/actions)\n[![GitHub license](https://img.shields.io/github/license/Natooz/MidiTok.svg)](https://github.com/Natooz/TorchToolkit/blob/main/LICENSE)\n\nHi \ud83d\udc4b, this is a small Python package containing useful functions to use with PyTorch.\nIt includes [utilities](torchtoolkit/utils.py), [metrics](torchtoolkit/metrics.py) and [sampling](torchtoolkit/sampling.py) methods to use during and after training a model.\n\nFeel free to use it, take the code for your projects, and raise an issue if you have question or a pull request if you want to contribute.\n\n```shell\npip install torchtoolkit\n```\nIt requires Python 3.8 or above.\n\nSimplest example:\n\n```python\nfrom torchtoolkit.metrics import Accuracy\nfrom torch import randint, randn\nfrom pathlib import Path\n\nacc = Accuracy(mode='top_k', top_kp=5)\nfor _ in range(10):\n    res = randn((16, 32))\n    expected = randint(0, 32, (16, ))\n    acc(res, expected)  # saving results\nacc.save(Path('path', 'to', 'save', 'file.csv'))\nacc.analyze()\n```\n\nI built it for my own usage, so you won't find documentation besides the docstring.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Useful functions to use with PyTorch",
    "version": "0.0.4",
    "split_keywords": [
        "artificial intelligence",
        "deep learning",
        "transformer",
        "nlp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "2decac37404654c0f6aefbe111691c98",
                "sha256": "680586004127abd99de48c0525d36349ccf35fc3fb7fa90dd338640ad31650a2"
            },
            "downloads": -1,
            "filename": "torchtoolkit-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2decac37404654c0f6aefbe111691c98",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13863,
            "upload_time": "2022-12-10T10:33:53",
            "upload_time_iso_8601": "2022-12-10T10:33:53.769802Z",
            "url": "https://files.pythonhosted.org/packages/94/30/af7e2f7953289a6877e600809f863ddf4649b6e753d3674178f2f7ede504/torchtoolkit-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "d4ed62dcbee4336c8dac09b79f172d5b",
                "sha256": "1aa7351afe41a834e724bbae162eb023f76f8f1cd3569e01a33bb6b5ed73ad24"
            },
            "downloads": -1,
            "filename": "torchtoolkit-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "d4ed62dcbee4336c8dac09b79f172d5b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 14911,
            "upload_time": "2022-12-10T10:33:55",
            "upload_time_iso_8601": "2022-12-10T10:33:55.566871Z",
            "url": "https://files.pythonhosted.org/packages/d8/15/d58824cb66c1c34840b83e464db40c960ae58aa16f25f2a45ecf7a98de4e/torchtoolkit-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-10 10:33:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Natooz",
    "github_project": "TorchToolkit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "torch",
            "specs": [
                [
                    ">=",
                    "1.10.0"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "1.19.0"
                ]
            ]
        },
        {
            "name": "tqdm",
            "specs": []
        }
    ],
    "lcname": "torchtoolkit"
}
        
Elapsed time: 0.01834s