Skip to main content

Graph wavelet scattering transform encoder for PyTorch Geometric

Project description

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

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

graph_wavelet_encoder-0.1.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

graph_wavelet_encoder-0.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: graph_wavelet_encoder-0.1.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for graph_wavelet_encoder-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2375c32fdccf564494e5b640477bb99f3c75d9b6095fd261c53bd476c76d6897
MD5 547600491c6b581d0346ef57505410a0
BLAKE2b-256 ef561c36b19d06538b7fb85f192dbedd5ddfc4729bcf68b5ab04f8056752435b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for graph_wavelet_encoder-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43a165f7cacbe42cf81e073d652e9321fc4316ae3339d19fc68ddfd6283e7330
MD5 bd5a48049811f13f345d60791788ad0b
BLAKE2b-256 5276f2bf6750e7aec0e516087cdfb814f15ba38e5322ba9f6aa81575a7b276fc

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