{"id":22229742,"url":"https://github.com/graph-com/spe","last_synced_at":"2025-07-27T19:31:42.190Z","repository":{"id":198309693,"uuid":"700088211","full_name":"Graph-COM/SPE","owner":"Graph-COM","description":"Official code for SPE ","archived":false,"fork":false,"pushed_at":"2024-09-15T09:16:02.000Z","size":252,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-15T11:55:36.972Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Graph-COM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-03T23:21:42.000Z","updated_at":"2024-09-15T09:16:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"dafe9f18-3219-4034-a6fe-c20bf7738733","html_url":"https://github.com/Graph-COM/SPE","commit_stats":null,"previous_names":["graph-com/spe"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graph-COM%2FSPE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graph-COM%2FSPE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graph-COM%2FSPE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graph-COM%2FSPE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Graph-COM","download_url":"https://codeload.github.com/Graph-COM/SPE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227830952,"owners_count":17826154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T01:12:11.789Z","updated_at":"2024-12-03T01:12:12.226Z","avatar_url":"https://github.com/Graph-COM.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# On the Expressivity of Stable Positional Encodings for Graphs\n\n## About\n\nThis is the official code for the paper: [On the Expressivity of Stable Positional Encodings for Graphs](https://arxiv.org/abs/2310.02579). \n\nFeel free to contact yinan8114@gmail.com if there is any question.\n\n![model](model.png)\n\n## Introduction\n\nIn this work, we present SPE, a Laplacian-based graph positional encodings that are provably stable and expressive. The key insight is to perform a **soft and learnable** ``partition\" of eigensubspaces in an **eigenvalue dependent** way, hereby achieving both stability (from the soft partition) and expressivity (from dependency on both eigenvalues and eigenvectors). \n\n\nOur SPE method processes eigenvectors $V\\in\\mathbb{R}^{n\\times d}$ and eigenvalues $\\lambda\\in\\mathbb{R}^d$ into node positional encodings as follows:\n$$\\text{SPE}(V, \\lambda)=\\rho(V\\text{diag}\\{\\phi_1(\\lambda)\\}V^{T}, V\\text{diag}\\{\\phi_2(\\lambda)\\}V^{T}, ..., V\\text{diag}\\{\\phi_m(\\lambda)\\}V^{T}),$$\nwhere $\\rho:\\mathbb{R}^{n\\times n\\times m}\\to\\mathbb{R}^{n\\times p}$ and $\\phi_i:\\mathbb{R}^{d}\\to\\mathbb{R}^d$ are permutational equivariant functions w.r.t. $n\\times n$ and $d$ axes respectively.\n\n## Code usage\n\n### Requirements\n\nSee requirements.txt for necessary python environment.\n\n\n### Dataset\n\nDownload all required datasets from [here](https://drive.google.com/drive/folders/17nVALCgTz0LV8pVuoM0xQnRqwRH3Bz7a?usp=drive_link). The downloaded 'data' directory should be placed in the root direcotry. For example, './data/drugood', etc.\n\n### Reproduce experiments\n\nTo reproduce experiments on ZINC, cd to ./zinc and run\n```\npython runner.py --config_dirpath ../configs/zinc --config_name SPE_gine_gin_mlp_pe37.yaml --seed 0\n```\n\n\nTo reproduce experiments on Alchemy, cd to ./alchemy and run\n```\npython --config_dirpath ../configs/alchemy --config_name SPE_gine_gin_mlp_pe12.yaml --seed 0\n```\n\nTo reproduce experiments on DrugOOD, cd to ./drugood and run\n```\npython --config_dirpath ../configs/assay --config_name SPE_gine_gin_mlp_pe32_zeropsi.yaml --dataset assay --seed 0\npython --config_dirpath ../configs/scaffold --config_name SPE_gine_gin_mlp_pe32_standard_dropout.yaml --dataset scaffold --seed 0\npython --config_dirpath ../configs/scaffold --config_name SPE_gine_gin_mlp_pe32_standard_dropout.yaml --dataset size --seed 0\n```\n\nTo reproduce substructures counting, cd to ./count and run\n```\nbash run.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraph-com%2Fspe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraph-com%2Fspe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraph-com%2Fspe/lists"}