Skip to main content

A lightweight complex-valued neural network package built on PyTorch

Project description

ComplexTorch

Homepage | Documentation

Complex PyTorch

(Available on PyPI)

Author: Josiah W. Smith, Ph.D.

A lightweight complex-valued neural network package built on PyTorch.

This is a package built on PyTorch with the intention of implementing light-weight interfaces for common complex-valued neural network operations and architectures. Notably, we include efficient implementations for linear, convolution, and attention modules in addition to activation functions and normalization layers such as batchnorm and layernorm.

Although there is an emphasis on 1-D data tensors, due to a focus on signal processing, communications, and radar data, many of the routines are implemented for 2-D and 3-D data as well.

Version 1.1 Release Notes:

  • Methods have been renamed to reflect identical names in PyTorch, e.g., complextorch.nn.CVConv1d was renamed to complextorch.nn.Conv1d. This change was implemented for quick conversion from PyTorch to complextorch.
  • Use of torch.Tensor is now recommended over complextorch.CVTensor. Previous speed advantages of complextorch.CVTensor are no longer present if using a version of PyTorch newer than 2.1.0.
  • Similarly, previous implementations of complextorch.nn.Conv1d (for 1-D, 2-D, 3-D, and transposed convolution) and complextorch.nn.Lienar have been renamed with the prefix Slow as PyTorch's native convolution and linear operators now outperform that of complextorch. Now, complextorch.nn.Conv1d, for example, uses torch.nn.Conv1d with dtype=torch.float for maximum efficiency.

Documentation

Please see Read the Docs or our arXiv paper, which is also located at docs/complextorch_paper.pdf.

Dependencies

This library requires numpy and PyTorch.PyTorch should be installed to your environment using the compute platform (CPU/GPU) settings for your machine. PyTorch will not be automatically installed with the installation of complextorch and MUST be installed manually by the user.

Installation:

IMPORTANT: Prior to installation, install PyTorch to your environment using your preferred method using the compute platform (CPU/GPU) settings for your machine.

Using pip

pip install complextorch

From the source:

git clone https://github.com/josiahwsmith10/complextorch.git
cd complextorch
pip install -r requirements.txt
pip install . --use-pep517

Basic Usage

import complextorch as cT

x = cT.randn(64, 5, 7)

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

complextorch-1.1.6.tar.gz (42.2 kB view details)

Uploaded Source

Built Distribution

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

complextorch-1.1.6-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file complextorch-1.1.6.tar.gz.

File metadata

  • Download URL: complextorch-1.1.6.tar.gz
  • Upload date:
  • Size: 42.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for complextorch-1.1.6.tar.gz
Algorithm Hash digest
SHA256 33f5e0410d4c6286b4a0343941f1baedf8dda28dc5e0c39ff9b1e6f25a1a765d
MD5 2c51fc6085335e16d12711cabe0523ec
BLAKE2b-256 36eb8e16fe2c65b4c6ecfee11b2bb3d351b5ab0144b9a88fc02b0ce39552c641

See more details on using hashes here.

File details

Details for the file complextorch-1.1.6-py3-none-any.whl.

File metadata

  • Download URL: complextorch-1.1.6-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for complextorch-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 196a0c63fe3c50a014c763bc576d28cb67997c5c78ae4d0e3739756e5b8857d3
MD5 ceaa38148d4a9115ba5bbf3acf71e94a
BLAKE2b-256 4449d934671f0d3cb35838fcdd527ff32d5d7f3db6a4fbe5264a0acbbfc79b23

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