Releases: cai4cai/torchsparsegradutils
v0.1.3
What's Changed
- A simple notebook aiming at comparing different solvers by @tvercaut in #33
- Linting by @mhubii in #54
- Added simple workarounds for gather_mm and segment_mm by @tvercaut in #57
- Added .devcontainer setup and updated versions by @theo-barfoot in #59
- Automated package deployment to PYPI by @denproc in #48
New Contributors
Full Changelog: v0.1.2...v0.1.3
v0.1.2
🐛 Fixes:
- SparseMultivariateNormal Initialisation Warning: Addressed a user warning emerging from the SparseMultivariateNormal class initialisation due to arg_constraints not being defined.
- Enhancements to PairwiseVoxelEncoder:
- Module Inheritance: Adjusted PairwiseVoxelEncoder to inherit from torch.nn.Module, aligning it more closely with PyTorch's expected behavior for neural network modules.
- Device Management: Implemented the _apply function in PairwiseVoxelEncoder. This change facilitates the movement of indices created during class initialization to a designated device using methods such as .to(device), .cpu(), or .cuda().
- Device Property: Introduced the .device attribute for PairwiseVoxelEncoder. This property provides users with insights regarding the device to which the encoder's indices are assigned.
Note: v.0.1.1 was abandoned due to a code typo error (arg_contraints instead of arg_constraints)
v0.1.0
Release Notes:
We are excited to announce the first release of TorchSparseGradUtils, a suite of efficient utilities that extend the functionality of PyTorch sparse tensor operations to support sparse gradient back-propagation from sparse input tensors.
Here are the key features included in this release:
PyTorch Matrix operations with sparse gradients support:
- Sparse-Dense matrix multiplication with batch support sparse_matmul.
- Sparse-Dense triangular linear solver with batch support sparse_triangular_solve
- Sparse-Dense generic linear solver sparse_generic_solve
Sparse Gaussian Distribution:
- SparseMultivariateNormal Distribution parameterised by either a sparse lower triangular covariance or precision matrix with reparameterised sampling
Sparse Encoder:
- PairwiseVoxelEncoder to encode sparse matrices with relationships between pairs of voxels in local neighbourshoods of 3D volumetric images.
Sparse utilities:
- Convert COO indices and values to CSR indices and values with convert_coo_to_csr_indices_values, with batch support.
- Convert COO sparse tensors to CSR sparse tensors with batched support with convert_coo_to_csr
- Equivalent of torch.block_diag() for sparse COO and CSR matrices sparse_block_diag and a function to perform the reverse sparse_block_diag_split
- Equivalent of torch.eye for sparse COO and CSR matrices sparse_eye
- Equivalent of torch.stack() for sparse CSR tensors stack_csr
Generating Random Sparse Matrices:
- Equivalent of torch.rand() for sparse COO and CSR matrices rand_sparse
- rand_sparse_tri used for generating random strictly triangular sparse matrices in either COO or CSR format.
Additional backbone solvers implemented in pure PyTorch:
- BICGSTAB (ported from pykrylov) bicstab
- CG (ported from cornellius-gp/linear_operator) linear_cg
- LSMR (ported from pytorch-minimize) lsmr
- MINRES (ported from cornellius-gp/linear_operator) minres
CuPy and JAX solvers:
We also provide wrappers around cupy sparse solvers and jax sparse solvers. Allowing linear systems of PyTorch sparse matrices to be solved using a CuPy or JAX back-end:
- Sparse-Dense linear solver with CuPy back-end sparse_solve_c4t
- Sparse-Dense linear solver with JAX back-end sparse_solve_j4t
Installation:
This version can be installed using:
pip install torchsparsegradutils==0.1.0
We welcome any feedback, suggestions, and contributions via our issues page.
For more details about this release, you can refer to the Full Changelog.