{"id":21280619,"url":"https://github.com/borgwardtlab/neuralwalker","last_synced_at":"2025-04-14T12:53:31.570Z","repository":{"id":243035480,"uuid":"808586006","full_name":"BorgwardtLab/NeuralWalker","owner":"BorgwardtLab","description":"Official Pytorch implementation of NeuralWalker","archived":false,"fork":false,"pushed_at":"2024-06-06T15:49:48.000Z","size":27381,"stargazers_count":29,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T02:03:30.604Z","etag":null,"topics":["graph-neural-networks","graph-representation-learning","graph-transformer","random-walk","state-space-models"],"latest_commit_sha":null,"homepage":"https://arxiv.org/pdf/2406.03386","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BorgwardtLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-05-31T11:28:17.000Z","updated_at":"2025-03-13T02:19:05.000Z","dependencies_parsed_at":"2024-11-21T10:47:36.192Z","dependency_job_id":null,"html_url":"https://github.com/BorgwardtLab/NeuralWalker","commit_stats":null,"previous_names":["borgwardtlab/neuralwalker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2FNeuralWalker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2FNeuralWalker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2FNeuralWalker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2FNeuralWalker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BorgwardtLab","download_url":"https://codeload.github.com/BorgwardtLab/NeuralWalker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248885454,"owners_count":21177625,"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":["graph-neural-networks","graph-representation-learning","graph-transformer","random-walk","state-space-models"],"created_at":"2024-11-21T10:37:22.135Z","updated_at":"2025-04-14T12:53:31.539Z","avatar_url":"https://github.com/BorgwardtLab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :walking: NeuralWalker\n\n[![arXiv](https://img.shields.io/badge/arXiv-2406.03386-b31b1b.svg)][2]\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/learning-long-range-dependencies-on-graphs/node-classification-on-pascalvoc-sp-1)](https://paperswithcode.com/sota/node-classification-on-pascalvoc-sp-1?p=learning-long-range-dependencies-on-graphs)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/learning-long-range-dependencies-on-graphs/node-classification-on-coco-sp)](https://paperswithcode.com/sota/node-classification-on-coco-sp?p=learning-long-range-dependencies-on-graphs)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/learning-long-range-dependencies-on-graphs/link-prediction-on-pcqm-contact)](https://paperswithcode.com/sota/link-prediction-on-pcqm-contact?p=learning-long-range-dependencies-on-graphs)\n\nThe repository implements the NeuralWalker in [Pytorch Geometric][1] described in the following paper\n\n\u003eDexiong Chen, Till Schulz, and Karsten Borgwardt.\n[Learning Long Range Dependencies on Graphs via Random Walks][2], Preprint 2024.\n\n**TL;DR**: A novel random-walk based neural architecture for graph representation learning.\n\n## :book: Overview\n\n![NeuralWalker](images/overview.png)\n\nNeuralWalker samples random walks with a predefined sampling rate and length, then uses advanced sequence models to process them. \nAdditionally, local and global message passing can be employed to capture complementary information.\nThe main components of NeuralWalker are a random walk sampler, and a stack of neural walker blocks (a walk encoder block + a message passing block).\nEach walk encoder block has a walk embedder, a sequence layer, and a walk aggregator.\n\n- Random walk sampler: samples m random walks independently without replacement.\n- Walk embedder: computes walk embeddings given the node/edge embeddings at the current layer.\n- Sequence layer: any sequence model, e.g. CNNs, RNNs, Transformers, or state-space models.\n- Walk aggregator: aggregates walk features into node features via pooling of the node features encountered in all the walks passing through that node.\n\n## :hammer_and_wrench: Installation\n\nWe recommend the users to manage dependencies using [miniconda](https://docs.conda.io/projects/miniconda/en/latest) or [micromamba](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html):\n\n```bash\n# Replace micromamba with conda if you use conda or miniconda\nmicromamba env create -f environment.yaml \nmicromamba activate neuralwalker\npip install -e .\n```\n\n\u003e [!NOTE]\n\u003e Our code is also compatible with more recent Pytorch versions, your can use `micromamba env create -f environment_latest.yaml` for development purposes.\n\n\u003e [!TIP]\n\u003e NeuralWalker relies on a sequence model to process random walk sequences, such as CNNs, Transformers, or state-space models. If you encounter any issues when installing the state-space model [Mamba](https://github.com/state-spaces/mamba),\n\u003e please consult its installation guideline.\n\n## :bulb: Reproducing results\n\n### Running NeuralWalker on Benchmarking GNNs, LRGB, and OGB\n\nAll configurations for the experiments are managed by [hydra](https://hydra.cc/), stored in `./config`.\n\nBelow you can find the list of experiments conducted in the paper:\n\n- [Benchmarking GNNs](https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.datasets.GNNBenchmarkDataset.html#torch_geometric.datasets.GNNBenchmarkDataset): zinc, mnist, cifar10, pattern, cluster\n- [LRGB](https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.datasets.LRGBDataset.html#torch_geometric.datasets.LRGBDataset): pascalvoc, coco, peptides_func, peptides_struct, pcqm_contact\n- [OGB](https://ogb.stanford.edu/docs/graphprop/): ogbg_molpcba, ogbg_ppa, ogbg_code2\n\n```bash\n# You can replace zinc with any of the above datasets\npython train.py experiment=zinc\n\n# Running NeuralWalker with a different model architecture\npython train.py experiment=zinc experiment/model=conv+vn_3L\n```\n\n\u003e [!TIP]\n\u003e You can replace `conv+vn_3L` with any model provided in `config/experiment/model`, or a customized model by creating a new one in that folder.\n\n### Running NeuralWalker on node classification tasks\n\nWe integrate NeuralWalker with Polynormer, SOTA model for node classifcation. See [node_classifcation](./node_classification) for more details.\n\n\n### Debug mode\n\n```bash\npython train.py mode=debug\n```\n\n\n[1]: https://pytorch-geometric.readthedocs.io/\n[2]: https://arxiv.org/abs/2406.03386\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborgwardtlab%2Fneuralwalker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborgwardtlab%2Fneuralwalker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborgwardtlab%2Fneuralwalker/lists"}