Metadata-Version: 2.4
Name: convd
Version: 0.0.2
Summary: High Dimensional Convolution Layers.
Project-URL: Homepage, https://github.com/kkt-ee/convd
Project-URL: Issues, https://github.com/kkt-ee/convd/issues
Author-email: Kishore Kumar Tarafdar <kkt.webmail@gmail.com>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Requires-Dist: tensorflow>=2.15
Description-Content-Type: text/markdown

# convd: D-dimensional Convolution Layers (D>3)

[![PyPI Version](https://img.shields.io/pypi/v/convd?label=PyPI&color=gold)](https://pypi.org/project/convd/)
[![Python Versions](https://img.shields.io/pypi/pyversions/convd)](https://pypi.org/project/convd/)
[![TensorFlow Version](https://img.shields.io/badge/tensorflow-2.15%2B-darkorange)](https://www.tensorflow.org/)
[![License](https://img.shields.io/badge/license-Apache%202.0-deepgreen.svg?style=flat)](LICENSE)


High-dimensional convolution layers for TensorFlow/Keras.

```python
from convd import FFTConvD, SeparableConv4D, SeparableConv6D
```

## Minimal example of 4D convolution

```python
import tensorflow as tf
from convd import FFTConvD

# Shape: [batch, x1, x2, x3, x4, channels]
x = tf.random.normal([1, 8, 8, 8, 8, 1])
y = FFTConvD(filters=4, kernel_size=3)(x)

print(y.shape)  # (1, 8, 8, 8, 8, 4)
```

## Minimal example of 6D convolution

```python
import tensorflow as tf
from convd import FFTConvD

# Shape: [batch, x1, x2, x3, x4, x5, x6, channels]
x = tf.random.normal([1, 4, 4, 4, 4, 4, 4, 1])
y = FFTConvD(filters=4, kernel_size=3)(x)

print(y.shape)  # (1, 4, 4, 4, 4, 4, 4, 4)
```

## Capabilities

- `FFTConvD`: circular convolution for square 1D-6D inputs.
- `SeparableConv4D`: separable 4D convolution using 2D kernels.
- `SeparableConv6D`: separable 6D convolution using 3D kernels.

## Limitations

- `FFTConvD` requires equal spatial sizes, for example `N x N` or `N x N x N`.
- `FFTConvD` supports up to 6 spatial dimensions.
- 7D+ is not currently supported because TensorFlow `tf.pad` does not support the required tensor rank.
- `FFTConvD` requires `kernel_size <= N`.
- `FFTConvD` is circular convolution, not zero-padded linear convolution.

## Citation

This software is released for broad research, educational, and engineering use. If this package helps your work, please cite the following paper:

```bibtex
@misc{tarafdar2026interpretablefrugallearningsystems,
      title={Interpretable and Frugal Learning Systems Employing Multiresolution Pyramids and Volterra Kernels},
      author={Kishore Kumar Tarafdar},
      year={2026},
      eprint={2606.15011},
      archivePrefix={arXiv},
      primaryClass={eess.SP},
      url={https://arxiv.org/abs/2606.15011},
}
```

## License

Apache License 2.0. See [`LICENSE`](LICENSE).
