Skip to main content

A Python library for novel and experimental deep learning layers.

Project description

DeepResearchLayers

Python Pytest PyPI License Version Maintained zread

A Python library for novel and experimental deep learning layers.

deep_layers bridges the gap between mathematical theory and usable code, providing "plug-and-play" implementations for PyTorch (and TensorFlow/Keras) of complex layers from research papers.

Features

Dual-Backend Compatibility

Supports both PyTorch and TensorFlow (via deep_layers/torch and deep_layers/tf).

Implemented Layers

All layers are available for both PyTorch and TensorFlow.

deep_layers.vision

  • CoordConv (coord_conv): Coordinate Convolution.
  • DropBlock (dropblock): Structured dropout regularization.
  • GLU (glu): Gated Linear Unit.
  • Involution (involution): Inverted convolution.

deep_layers.sequence

  • Hyena (hyena): Hyena Hierarchy operator.
  • Linear Attention (linear_attention): Transformers are RNNs.
  • Mamba (mamba): Selective State Space Model.
  • Retention (retention): RetNet layer.

deep_layers.graph

  • GCN (gcn): Graph Convolutional Network.
  • NTN (ntn): Neural Tensor Network.
  • PointNet (pointnet): PointNet Set Abstraction.
  • Set Transformer (set_transformer): Permutation-invariant attention.
  • SGR (sgr): Symbolic Graph Reasoning.

deep_layers.scientific

  • CORAL (coral): Coordinate-based Neural Field Operator.
  • DeepONet (deeponet): Deep Operator Network.
  • DEQ (deq): Deep Equilibrium Models.
  • HyperLayer (hyperlayer): HyperNetwork-based dynamic layer.
  • KAN (kan): Kolmogorov-Arnold Network.
  • Neural ODE (neural_ode): Ordinary Differential Equation solver layer.
  • PhyCRNet (phycrnet): Physics-Informed Convolutional-Recurrent.
  • PirateNet (piratenet): Physics-Informed Residual Adaptive Network.
  • Sparse Memory (sparse_memory): Differentiable memory with sparse reads/writes.
  • Steerable Conv (steerable_conv): E(2)-Equivariant Steerable CNN.
  • VQ (vq): Vector Quantization layer.

Installation

Install with PyTorch support:

pip install "deep_layers[torch]"

Install with TensorFlow support:

pip install "deep_layers[tf]"

Install with both:

pip install "deep_layers[all]"

For development/editable install:

git clone https://github.com/yourusername/deep_layers.git
cd deep_layers
pip install -e .

Usage

PyTorch Example

import torch
from deep_layers.torch.vision import CoordConv

# Initialize layer
layer = CoordConv(in_channels=3, out_channels=64, kernel_size=3)

# Forward pass
x = torch.randn(1, 3, 224, 224)
output = layer(x)
print(output.shape)

TensorFlow Example

import tensorflow as tf
from deep_layers.tf.vision import CoordConv

# Initialize layer
layer = CoordConv(filters=64, kernel_size=3)

# Forward pass
x = tf.random.normal((1, 224, 224, 3))
output = layer(x)
print(output.shape)

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

deep_layers-0.1.0.tar.gz (95.2 kB view details)

Uploaded Source

Built Distribution

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

deep_layers-0.1.0-py3-none-any.whl (77.3 kB view details)

Uploaded Python 3

File details

Details for the file deep_layers-0.1.0.tar.gz.

File metadata

  • Download URL: deep_layers-0.1.0.tar.gz
  • Upload date:
  • Size: 95.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deep_layers-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c575080b4b430fb85df7a78c1718e84dd4f1f541e35f4e0a1360df09dc506a3f
MD5 58d85a8f7a394935f8c116586c9fe321
BLAKE2b-256 712ddf1383244590b4146b4409fa80ee7adf2dcee5b67d34af3dfe84259fc617

See more details on using hashes here.

Provenance

The following attestation bundles were made for deep_layers-0.1.0.tar.gz:

Publisher: publish.yml on kuslavicek/deep_layers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deep_layers-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: deep_layers-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 77.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deep_layers-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f06c48f28e735508fb375f1c8461684e3b7216a10b9c212aa1e5ea50a341ec09
MD5 ece87e5f30231f787df572f06b2ada82
BLAKE2b-256 638aaa63dbfbdf03d501828e5f74978a614dfcb4a81eb0b40b59285cac00d5b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for deep_layers-0.1.0-py3-none-any.whl:

Publisher: publish.yml on kuslavicek/deep_layers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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