pytorch_runstats
Running/online statistics for PyTorch.
torch_runstats implements memory-efficient online reductions on tensors.
Notable features:
- Arbitrary sample shapes beyond single scalars
- Reduction over arbitrary dimensions of each sample
- "Batched"/"binned" reduction into multiple running tallies using a per-sample bin index.
This can be useful, for example, in accumulating statistics over samples by some kind of "type" index or for accumulating statistics per-graph in a
pytorch_geometric-like batching scheme. (This feature is similar totorch_scatter.) - Option to ignore NaN values with correct sample counting.
Note: the implementations currently heavily uses in-place operations for peformance and memory efficiency. This probably doesn't play nice with the autograd engine — this is currently likely the wrong library for accumulating running statistics you want to backward through. (See TorchMetrics for a possible alternative.)
For more information, please see the docs.
Install
torch_runstats requires PyTorch.
The library can be installed from PyPI:
$ pip install torch_runstats
The latest development version of the code can also be installed from git:
$ git clone https://github.com/mir-group/pytorch_runstats
and install it by running
$ cd torch_runstats/
$ pip install .
You can run the tests with
$ pytest tests/
License
pytorch_runstats is distributed under an MIT license.
Release files for torch-runstats 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| torch_runstats-0.2.0.tar.gz | 8.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| torch_runstats-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / torch_runstats-0.2.0.tar.gz
| Download URL | torch_runstats-0.2.0.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc7f32887103c820bd7cc710b9c476d1ec56a68a3ff9a42b9b56758bfb8afd97
|
|
BLAKE2b-256 checksum How to use checksums |
100f0b7710b63cf4fe09c8710db208a2c5cf66b1e09efbbcae0adc6fcf149caa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
|
Release files / torch_runstats-0.2.0-py3-none-any.whl
| Download URL | torch_runstats-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba5a5214e1154aac8cca383943e7a9029e412f62e663002ede9c3dd19b947847
|
|
BLAKE2b-256 checksum How to use checksums |
4f81021f56cdddce39a04c51abfd17af52f3fba91d30b699af5e5352f8abbff6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
|