Skip to main content

Graph Wavelet Encoder

Graph wavelet scattering transform encoder for PyTorch Geometric. Computes multi-scale wavelet features from graph structure and node signals using lazy random-walk diffusion.

Installation

pip install graph-wavelet-encoder

For development (editable install):

pip install -e .

With dev dependencies (pytest, etc.):

pip install -e ".[dev]"

Usage

import torch
from torch_geometric.data import Data, Batch
from graph_wavelet_encoder import GraphWaveletEncoder

# Single graph or batched PyG Data
# Expects: .x (node features), .edge_index, .batch (for batched graphs)
encoder = GraphWaveletEncoder(
    scales=(1, 2, 4, 8, 16),
    sigma=2.0,
    device=torch.device("cuda" if torch.cuda.is_available() else "cpu"),
)
features = encoder.encode(graph)  # [batch_size, num_nodes, num_features_per_node]

The encoder uses a lazy random-walk matrix and produces zeroth-, first-, and second-order scattering coefficients. See the docstrings in graph_wavelet_encoder.encoder for details.

Development

  • Package layout: src layout — package lives under src/graph_wavelet_encoder/.

Testing and benchmarking

pytest tests/test_encoder.py -v -s

License

Yale Licence

Metadata

Release files for graph-wavelet-encoder 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graph-wavelet-encoder 0.1.0
File Size Uploaded
graph_wavelet_encoder-0.1.0.tar.gz 16.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graph-wavelet-encoder 0.1.0
File Interpreter ABI Platform
graph_wavelet_encoder-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.6 kB

Release files / graph_wavelet_encoder-0.1.0.tar.gz

Download URL graph_wavelet_encoder-0.1.0.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2375c32fdccf564494e5b640477bb99f3c75d9b6095fd261c53bd476c76d6897
BLAKE2b-256 checksum
How to use checksums
ef561c36b19d06538b7fb85f192dbedd5ddfc4729bcf68b5ab04f8056752435b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release files / graph_wavelet_encoder-0.1.0-py3-none-any.whl

Download URL graph_wavelet_encoder-0.1.0-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43a165f7cacbe42cf81e073d652e9321fc4316ae3339d19fc68ddfd6283e7330
BLAKE2b-256 checksum
How to use checksums
5276f2bf6750e7aec0e516087cdfb814f15ba38e5322ba9f6aa81575a7b276fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page