Skip to main content

N-dimensional convolutional operators for various semifields

Project description

Pytorch N-Dimensional Semifield Convolutions

Documentation | PyPi

PyTorch provides efficient implementations of linear convolution operators, as well as max-pooling operators. Both of these operators can be considered a kind of semifield convolution, where the semifield defines what 'addition' and 'multiplication' mean.

However, there are other semifields that we may wish to use than the linear. As such, this package aims to simplify the process of implementing new semifield convolutions, as well as providing definitions for standard semifields.

These new semifields can be defined using PyTorch broadcasting operators using BroadcastSemifield, or using SelectSemifield / SubtractSemifield in the cases where no appropriate PyTorch operator exists.

The implementations, while not as optimised as the base PyTorch versions, have decent performance. BroadcastSemifield relies on chaining optimised PyTorch operators but suffers from higher memory usage, while SelectSemifield / SubtractSemifield are custom CUDA operators, optionally JIT compiled into PyTorch extensions using my other library pytorch-numba-extension-jit.

Finally, all three implementations work in arbitrary dimensionality: they support 1D, 2D or any dimensionality of inputs and kernels (though the example kernels provided are only 2D).

This package is listed on PyPi; it can be installed with

pip install pytorch-nd-semiconv

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

pytorch_nd_semiconv-0.1.1.tar.gz (111.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytorch_nd_semiconv-0.1.1-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file pytorch_nd_semiconv-0.1.1.tar.gz.

File metadata

  • Download URL: pytorch_nd_semiconv-0.1.1.tar.gz
  • Upload date:
  • Size: 111.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.26

File hashes

Hashes for pytorch_nd_semiconv-0.1.1.tar.gz
Algorithm Hash digest
SHA256 948088cba28d05a380944f57bdc6bf55b47411b6491fff7963785d8fb9f30215
MD5 e92473dc3c2dfbc9aa4df044781a58ce
BLAKE2b-256 c72e11388c64a453959a575ce10e67fc52202e5acc4e2830b0f30cee42dfab03

See more details on using hashes here.

File details

Details for the file pytorch_nd_semiconv-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytorch_nd_semiconv-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d47a5facfb84cb11ba480dee310c057ac77ae9f259786c910f98dc2b35ffc54e
MD5 bdaecf0133f6e28a2f5587d9ffe859eb
BLAKE2b-256 9bf717730ddc817bb830bfde8a3ca15ddaa7526c232929d4937e12fadbc50461

See more details on using hashes here.

Supported by

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