Skip to main content

Useful functions to use with PyTorch

Project description

TorchToolkit

PyPI version fury.io

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.3.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

torchtoolkit-0.0.3-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file torchtoolkit-0.0.3.tar.gz.

File metadata

  • Download URL: torchtoolkit-0.0.3.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for torchtoolkit-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4124822caf9623ddea374c30815b64f6505272dd4d37837d3661dc300579e701
MD5 99d880010002b1166b95fe8881216af1
BLAKE2b-256 a395366eaa97f37a9df73ae599c86e0e0ba3a6f1002aa01d23f9307f6e30f1bc

See more details on using hashes here.

File details

Details for the file torchtoolkit-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: torchtoolkit-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for torchtoolkit-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c3fbe10619027594b0b63e78f39fa04223463f40364efd95b8faebedda98a297
MD5 30071ce6c7891821e3b2012167245d9b
BLAKE2b-256 63882661e2cd8068afcd1a760f7cfdf3c2f0f8472a0da338b43c6cc22d3f1246

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page