A lightweight complex-valued neural network package built on PyTorch
Project description
ComplexTorch
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.CVConv1dwas renamed tocomplextorch.nn.Conv1d. This change was implemented for quick conversion from PyTorch tocomplextorch. - Use of
torch.Tensoris now recommended overcomplextorch.CVTensor. Previous speed advantages ofcomplextorch.CVTensorare 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) andcomplextorch.nn.Linearhave been renamed with the prefixSlowas PyTorch's native convolution and linear operators now outperform that ofcomplextorch. Now,complextorch.nn.Conv1d, for example, usestorch.nn.Conv1dwithdtype=torch.floatfor 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file complextorch-1.2.0.tar.gz.
File metadata
- Download URL: complextorch-1.2.0.tar.gz
- Upload date:
- Size: 132.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18f21f885f832e5f9e6440644f561930d620adebf817cf0d7d19905d1d9ad252
|
|
| MD5 |
2b8c915096d6336bdacdb75a2c3ba885
|
|
| BLAKE2b-256 |
d7da9040b8a1bf008ea54fbfeaf4f0358fe3f601a9263b00d7f24441dbe17106
|
File details
Details for the file complextorch-1.2.0-py3-none-any.whl.
File metadata
- Download URL: complextorch-1.2.0-py3-none-any.whl
- Upload date:
- Size: 51.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
653c34062908f2a552066d5f4b99baa129df68e5531e80945283ba6c3e4817fd
|
|
| MD5 |
3958788b6f25f48ee1659bd0550014c8
|
|
| BLAKE2b-256 |
ccf7fceb9a8bd423d6684cd9c7ef7cdbead0971562b68118441dbfc12f3b21e2
|