Useful functions to use with PyTorch
Project description
TorchToolkit
Hi 👋, this is a small Python package containing useful functions to use with PyTorch. It includes utilities, metrics and sampling 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.
pip install torchtoolkit
It requires Python 3.8 or above.
Simplest example:
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.
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
torchtoolkit-0.0.4.tar.gz
(14.9 kB
view details)
Built Distribution
File details
Details for the file torchtoolkit-0.0.4.tar.gz
.
File metadata
- Download URL: torchtoolkit-0.0.4.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aa7351afe41a834e724bbae162eb023f76f8f1cd3569e01a33bb6b5ed73ad24 |
|
MD5 | d4ed62dcbee4336c8dac09b79f172d5b |
|
BLAKE2b-256 | d815d58824cb66c1c34840b83e464db40c960ae58aa16f25f2a45ecf7a98de4e |
File details
Details for the file torchtoolkit-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: torchtoolkit-0.0.4-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 680586004127abd99de48c0525d36349ccf35fc3fb7fa90dd338640ad31650a2 |
|
MD5 | 2decac37404654c0f6aefbe111691c98 |
|
BLAKE2b-256 | 9430af7e2f7953289a6877e600809f863ddf4649b6e753d3674178f2f7ede504 |