Skip to main content

Fast Discrete Shearlet Transform layers in TensorFlow

Project description

TFDST: Fast Discrete Shearlet Transform Layers in TensorFlow

PyPI Version TensorFlow License

TFDST provides differentiable TensorFlow/Keras layers for fast 2D and 3D discrete shearlet transforms and their inverse transforms.

Copyright 2025 Kishore Kumar Tarafdar. Filter-bank construction follows mathematical structure developed with credit to Vineet Ghule. This implementation provides differentiable TensorFlow/Keras layers with batched multichannel support and performance-oriented updates.

Capabilities

  • DST2D / IDST2D through transform=None or transform="inverse"
  • DST3D / IDST3D through transform=None or transform="inverse"
  • Batched multichannel TensorFlow tensors
  • Backpropagation through the transform layers

Limitations

  • Inputs are expected to match the configured spatial size N.
  • 2D input shape: [batch, N, N, channels].
  • 3D input shape: [batch, N, N, N, channels].
  • Wavelet filter coefficients are provided through PyWavelets.

Installation

pip install TFDST

Minimal Example

import tensorflow as tf
from TFDST.DST2DFB import DST2D
from TFDST.DST3DFB import DST3D

N = 32

# 2D
x2 = tf.random.normal([1, N, N, 1])
dst2 = DST2D(N=N, J=2, L=[1, 2], B=[4, 8], norm=True, wave="bior1.5")
idst2 = DST2D(N=N, J=2, L=[1, 2], B=[4, 8], norm=True, wave="bior1.5", transform="inverse")
y2 = dst2(x2)
r2 = idst2(y2)

# 3D
x3 = tf.random.normal([1, N, N, N, 1])
dst3 = DST3D(N=N, J=2, L=[1, 2], B=[4, 8], norm=True, wave="bior1.5")
idst3 = DST3D(N=N, J=2, L=[1, 2], B=[4, 8], norm=True, wave="bior1.5", transform="inverse")
y3 = dst3(x3)
r3 = idst3(y3)

print(x2.shape, r2.shape)
print(x3.shape, r3.shape)

Arguments

Argument Meaning
N Spatial size of each axis; 2D uses N x N, 3D uses N x N x N.
J Number of multiscale shearlet levels.
L Shear parameters per level; must have length J.
B Bandwidth/window parameters per level; must have length J.
wave PyWavelets wavelet name used for the radial wavelet filters, e.g. "bior1.5".
norm If True, applies filter-bank normalization.
transform Use None for forward DST and "inverse" for inverse DST.

License

Apache License 2.0. See LICENSE.

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

tfdst-0.0.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

tfdst-0.0.1-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file tfdst-0.0.1.tar.gz.

File metadata

  • Download URL: tfdst-0.0.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for tfdst-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ee111bfd842b8f5fa33a867f2c6bd2a4c51a8a565211ff503539199fb4b6c687
MD5 ad5ee4f93773bb102fc2d6bbfdf2fc2b
BLAKE2b-256 58f25f08681d8f74f7327f7e522c29f74d99d1a026042b24c1ad6e531f3c9196

See more details on using hashes here.

File details

Details for the file tfdst-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: tfdst-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for tfdst-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5e787589000d06b59674e52025a6da75647a7651a72161b89b74909ab745688
MD5 0bcd875320bb50fc709d925fbd9f84a8
BLAKE2b-256 63f4bab2b6feb0801ba2732deff1ce4f0737c683682776403b7b8aa4a90d2834

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