Torch Vectorized
Batched and vectorized operations on volume of 3x3 symmetric matrices with Pytorch. The current Pytorch's implementation of batch eigen-decomposition is very slow when dealing with huge number of small matrices (e.g. 500k x 3x3). This library offers some basic functions like vSymEig, vExpm and vLogm for fast computation (>250x faster) of huge number of small matrices with Pytorch using an analytical solution.
Read the documentaton HERE
vSymEig
A quick closed-form solution for volumetric 3x3 matrices Eigen-Decomposition with Pytorch. Solves Eigen-Decomposition of data with shape Bx9xDxHxW, where B is the batch size, 9 is the flattened 3x3 symmetric matrices, D is the depth, H is the Height, W is the width. The goal is to accelerate the Eigen-Decomposition of multiple (>500k) small matrices (3x3) on GPU with Pytorch using an analytical solution.
vExpm
Based on vSymEig, computes the matrix exponential for batch of volumetric 3x3 matrices.
vLogm
Based on vSymEig, computes the matrix logarithm for batch of volumetric 3x3 matrices.
Install me
pip install torch-vectorized
How to use
import torch
from torchvectorized.utils import sym
from torchvectorized.vlinalg import vSymEig
# Random batch of volumetric 3x3 symmetric matrices of size 16x9x32x32x32
input = sym(torch.rand(16, 9, 32, 32, 32))
# Output eig_vals with size: 16x3x32x32x32 and eig_vecs with size 16,3,3,32,32,32
eig_vals, eig_vecs = vSymEig(input, eigenvectors=True)
Contributing
How to contribute ?
- Create a branch by feature and/or bug fix
- Get the code
- Commit and push
- Create a pull request
Branch naming
Feature branch
feature/ [Short feature description] [Issue number]
Bug branch
fix/ [Short fix description] [Issue number]
Commits syntax:
Adding code:
+ Added [Short Description] [Issue Number]
Deleting code:
- Deleted [Short Description] [Issue Number]
Modifying code:
* Changed [Short Description] [Issue Number]
Merging code:
Y Merged [Short Description] [Issue Number]
Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY
Metadata
Release files for torch-vectorized 0.1.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| torch-vectorized-0.1.18.tar.gz | 7.2 kB | Without provenance | Details for torch-vectorized-0.1.18.tar.gz |
Release files / torch-vectorized-0.1.18.tar.gz
| Download URL | torch-vectorized-0.1.18.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1209754676ad2728dc5da2759ab9a5afde5c85fa590cf1606fcb42f393738927
|
|
BLAKE2b-256 checksum How to use checksums |
755596877a789b06ddf431a1ce9b4511cd2b541d1a52822475084ac00d5adae6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.2
|
Security for torch-vectorized 0.1.18
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.