{"id":13444203,"url":"https://github.com/PetarV-/GAT","last_synced_at":"2025-03-20T18:31:24.037Z","repository":{"id":37645103,"uuid":"119770380","full_name":"PetarV-/GAT","owner":"PetarV-","description":"Graph Attention Networks (https://arxiv.org/abs/1710.10903)","archived":false,"fork":false,"pushed_at":"2022-04-09T20:10:06.000Z","size":4821,"stargazers_count":3311,"open_issues_count":31,"forks_count":657,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-03-16T20:54:11.857Z","etag":null,"topics":["attention-mechanism","graph-attention-networks","neural-networks","python","self-attention","tensorflow"],"latest_commit_sha":null,"homepage":"https://petar-v.com/GAT/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PetarV-.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}},"created_at":"2018-02-01T02:17:22.000Z","updated_at":"2025-03-16T05:47:57.000Z","dependencies_parsed_at":"2022-07-11T00:30:30.513Z","dependency_job_id":null,"html_url":"https://github.com/PetarV-/GAT","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PetarV-%2FGAT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PetarV-%2FGAT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PetarV-%2FGAT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PetarV-%2FGAT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PetarV-","download_url":"https://codeload.github.com/PetarV-/GAT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244670138,"owners_count":20490925,"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":["attention-mechanism","graph-attention-networks","neural-networks","python","self-attention","tensorflow"],"created_at":"2024-07-31T03:02:21.771Z","updated_at":"2025-03-20T18:31:23.632Z","avatar_url":"https://github.com/PetarV-.png","language":"Python","readme":"# GAT\nGraph Attention Networks (Veličković *et al.*, ICLR 2018): [https://arxiv.org/abs/1710.10903](https://arxiv.org/abs/1710.10903)\n\nGAT layer            |  t-SNE + Attention coefficients on Cora\n:-------------------------:|:-------------------------:\n![](https://camo.githubusercontent.com/4fe1a90e67d17a2330d7cfcddc930d5f7501750c/68747470733a2f2f7777772e64726f70626f782e636f6d2f732f71327a703170366b37396a6a6431352f6761745f6c617965722e706e673f7261773d31)  |  ![](https://raw.githubusercontent.com/PetarV-/GAT/gh-pages/assets/t-sne.png)\n\n## Overview\nHere we provide the implementation of a Graph Attention Network (GAT) layer in TensorFlow, along with a minimal execution example (on the Cora dataset). The repository is organised as follows:\n- `data/` contains the necessary dataset files for Cora;\n- `models/` contains the implementation of the GAT network (`gat.py`);\n- `pre_trained/` contains a pre-trained Cora model (achieving 84.4% accuracy on the test set);\n- `utils/` contains:\n    * an implementation of an attention head, along with an experimental sparse version (`layers.py`);\n    * preprocessing subroutines (`process.py`);\n    * preprocessing utilities for the PPI benchmark (`process_ppi.py`).\n\nFinally, `execute_cora.py` puts all of the above together and may be used to execute a full training run on Cora.\n\n## Sparse version\nAn experimental sparse version is also available, working only when the batch size is equal to 1.\nThe sparse model may be found at `models/sp_gat.py`.\n\nYou may execute a full training run of the sparse model on Cora through `execute_cora_sparse.py`.\n\n## Dependencies\n\nThe script has been tested running under Python 3.5.2, with the following packages installed (along with their dependencies):\n\n- `numpy==1.14.1`\n- `scipy==1.0.0`\n- `networkx==2.1`\n- `tensorflow-gpu==1.6.0`\n\nIn addition, CUDA 9.0 and cuDNN 7 have been used.\n\n## Reference\nIf you make advantage of the GAT model in your research, please cite the following in your manuscript:\n\n```\n@article{\n  velickovic2018graph,\n  title=\"{Graph Attention Networks}\",\n  author={Veli{\\v{c}}kovi{\\'{c}}, Petar and Cucurull, Guillem and Casanova, Arantxa and Romero, Adriana and Li{\\`{o}}, Pietro and Bengio, Yoshua},\n  journal={International Conference on Learning Representations},\n  year={2018},\n  url={https://openreview.net/forum?id=rJXMpikCZ},\n  note={accepted as poster},\n}\n```\n\nFor getting started with GATs, as well as graph representation learning in general, we **highly** recommend the [pytorch-GAT](https://github.com/gordicaleksa/pytorch-GAT) repository by [Aleksa Gordić](https://github.com/gordicaleksa). It ships with an inductive (PPI) example as well.\n\nGAT is a popular method for graph representation learning, with optimised implementations within virtually all standard GRL libraries:\n- \\[PyTorch\\] [PyTorch Geometric](https://pytorch-geometric.readthedocs.io/en/latest/)\n- \\[PyTorch/TensorFlow\\] [Deep Graph Library](https://www.dgl.ai/)\n- \\[TensorFlow\\] [Spektral](https://graphneural.network/)\n- \\[JAX\\] [jraph](https://github.com/deepmind/jraph)\n\nWe recommend using either one of those (depending on your favoured framework), as their implementations have been more readily battle-tested.\n\nEarly on post-release, two unofficial ports of the GAT model to various frameworks quickly surfaced. To honour the effort of their developers as early adopters of the GAT layer, we leave pointers to them here.\n- \\[Keras\\] [keras-gat](https://github.com/danielegrattarola/keras-gat), developed by [Daniele Grattarola](https://github.com/danielegrattarola);\n- \\[PyTorch\\] [pyGAT](https://github.com/Diego999/pyGAT), developed by [Diego Antognini](https://github.com/Diego999).\n\n## License\nMIT\n","funding_links":[],"categories":["Python","Implement:","Uncategorized","[Label Inference Methods](#content)","TensorFlow Implementations","图注意力机制"],"sub_categories":["Uncategorized","Graph Embedding Approaches","网络服务_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPetarV-%2FGAT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPetarV-%2FGAT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPetarV-%2FGAT/lists"}