Metadata-Version: 2.4
Name: graph-wavelet-encoder
Version: 0.1.0
Summary: Graph wavelet scattering transform encoder for PyTorch Geometric
Author-email: Chen Liu <chen.liu.cl2482@yale.edu>
License: ----------------------------------
        
        Non-Commercial License
        Yale Copyright © 2024 Yale University.
        
        Permission is hereby granted to use, copy, modify, and distribute this Software for any non-commercial purpose. Any distribution or modification or derivations of the Software (together “Derivative Works”) must be made available on GitHub and shall include this copyright notice and this permission notice in all copies or substantial portions of the Software.  For the purposes of this license, "non-commercial" means not intended for or directed towards commercial advantage or monetary compensation either via the Software itself or Derivative Works or uses of either which lead to or generate any commercial products. In any event, the use and modification of the Software or Derivative Works shall remain governed by the terms and conditions of this Agreement; Any commercial use of the Software requires a separate commercial license from the copyright holder at Yale University. Direct any requests for commercial licenses to Yale Ventures at yaleventures@yale.edu.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
        ----------------------------------
Project-URL: Homepage, https://github.com/KrishnaswamyLab/GraphWaveletEncoder
Project-URL: Repository, https://github.com/KrishnaswamyLab/GraphWaveletEncoder
Project-URL: Documentation, https://github.com/KrishnaswamyLab/GraphWaveletEncoder#readme
Keywords: graph,wavelet,scattering,torch-geometric,neural-network
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20
Requires-Dist: scipy>=1.7
Requires-Dist: torch>=1.9
Requires-Dist: torch-geometric>=2.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Dynamic: license-file

# Graph Wavelet Encoder

Graph wavelet scattering transform encoder for [PyTorch Geometric](https://pytorch-geometric.readthedocs.io/). Computes multi-scale wavelet features from graph structure and node signals using lazy random-walk diffusion.

## Installation

```bash
pip install graph-wavelet-encoder
```

For development (editable install):

```bash
pip install -e .
```

With dev dependencies (pytest, etc.):

```bash
pip install -e ".[dev]"
```

## Usage

```python
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](https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/) — package lives under `src/graph_wavelet_encoder/`.

### Testing and benchmarking

```bash
pytest tests/test_encoder.py -v -s
```

## License

Yale Licence
