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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2375c32fdccf564494e5b640477bb99f3c75d9b6095fd261c53bd476c76d6897
|
|
| MD5 |
547600491c6b581d0346ef57505410a0
|
|
| BLAKE2b-256 |
ef561c36b19d06538b7fb85f192dbedd5ddfc4729bcf68b5ab04f8056752435b
|
File details
Details for the file graph_wavelet_encoder-0.1.0-py3-none-any.whl.
File metadata
- Download URL: graph_wavelet_encoder-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43a165f7cacbe42cf81e073d652e9321fc4316ae3339d19fc68ddfd6283e7330
|
|
| MD5 |
bd5a48049811f13f345d60791788ad0b
|
|
| BLAKE2b-256 |
5276f2bf6750e7aec0e516087cdfb814f15ba38e5322ba9f6aa81575a7b276fc
|