{"id":25437713,"url":"https://github.com/christianlin0420/hgap","last_synced_at":"2025-05-15T06:11:47.609Z","repository":{"id":211275549,"uuid":"652130999","full_name":"ChristianLin0420/HGAP","owner":"ChristianLin0420","description":"Official implementation for ICML 2024 paper \"HGAP: Boosting Permutation Invariant and Permutation Equivariant in Multi-Agent Reinforcement Learning via Graph Attention Network\".","archived":false,"fork":false,"pushed_at":"2024-02-04T13:13:30.000Z","size":516,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T09:19:30.324Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://proceedings.mlr.press/v235/lin24m.html","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/ChristianLin0420.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}},"created_at":"2023-06-11T07:26:40.000Z","updated_at":"2025-02-13T01:45:20.000Z","dependencies_parsed_at":"2023-12-11T13:15:16.618Z","dependency_job_id":"6b2bfef9-c5a9-4aaf-8a03-642109d75630","html_url":"https://github.com/ChristianLin0420/HGAP","commit_stats":null,"previous_names":["christianlin0420/madp","christianlin0420/hgap"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChristianLin0420%2FHGAP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChristianLin0420%2FHGAP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChristianLin0420%2FHGAP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChristianLin0420%2FHGAP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChristianLin0420","download_url":"https://codeload.github.com/ChristianLin0420/HGAP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254283350,"owners_count":22045141,"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":"2025-02-17T09:19:33.183Z","updated_at":"2025-05-15T06:11:47.583Z","avatar_url":"https://github.com/ChristianLin0420.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hyper Graphical Attention Policy (HGAP) Network\n\nuniversalMARL is [WhiRL](http://whirl.cs.ox.ac.uk)'s framework for deep multi-agent reinforcement learning and includes implementations of the following algorithms:\n- [**QMIX**: QMIX: Monotonic Value Function Factorisation for Deep Multi-Agent Reinforcement Learning](https://arxiv.org/abs/1803.11485)\n- [**COMA**: Counterfactual Multi-Agent Policy Gradients](https://arxiv.org/abs/1705.08926)\n- [**VDN**: Value-Decomposition Networks For Cooperative Multi-Agent Learning](https://arxiv.org/abs/1706.05296) \n- [**IQL**: Independent Q-Learning](https://arxiv.org/abs/1511.08779)\n- [**QTRAN**: QTRAN: Learning to Factorize with Transformation for Cooperative Multi-Agent Reinforcement Learning](https://arxiv.org/abs/1905.05408)\n\nPyMARL is written in PyTorch and uses [SMAC](https://github.com/oxwhirl/smac) as its environment.\n\n## Installation instructions\n\nSet up StarCraft II and SMAC:\n```shell\nbash install_sc2.sh\n```\n\nThis will download SC2 into the 3rdparty folder and copy the maps necessary to run over.\n\nThe requirements.txt file can be used to install the necessary packages into a virtual environment (not recomended).\n\n## Run an experiment \n\n```shell\npython3 src/main.py --config=qmix --env-config=sc2 with env_args.map_name=2s3z\n```\n\nThe config files act as defaults for an algorithm or environment. \n\nThey are all located in `src/config`.\n`--config` refers to the config files in `src/config/algs`\n`--env-config` refers to the config files in `src/config/envs`\n\nTo run experiments using the Docker container:\n```shell\nbash run.sh $GPU python3 src/main.py --config=qmix --env-config=sc2 with env_args.map_name=2s3z\n```\n\nAll results will be stored in the `Results` folder.\n\nThe previous config files used for the SMAC Beta have the suffix `_beta`.\n\n## Saving and loading learnt models\n\n### Saving models\n\nYou can save the learnt models to disk by setting `save_model = True`, which is set to `False` by default. The frequency of saving models can be adjusted using `save_model_interval` configuration. Models will be saved in the result directory, under the folder called *models*. The directory corresponding each run will contain models saved throughout the experiment, each within a folder corresponding to the number of timesteps passed since starting the learning process.\n\n### Loading models\n\nLearnt models can be loaded using the `checkpoint_path` parameter, after which the learning will proceed from the corresponding timestep. \n\n## Watching StarCraft II replays\n\n`save_replay` option allows saving replays of models which are loaded using `checkpoint_path`. Once the model is successfully loaded, `test_nepisode` number of episodes are run on the test mode and a .SC2Replay file is saved in the Replay directory of StarCraft II. Please make sure to use the episode runner if you wish to save a replay, i.e., `runner=episode`. The name of the saved replay file starts with the given `env_args.save_replay_prefix` (map_name if empty), followed by the current timestamp. \n\nThe saved replays can be watched by double-clicking on them or using the following command:\n\n```shell\npython -m pysc2.bin.play --norender --rgb_minimap_size 0 --replay NAME.SC2Replay\n```\n\n**Note:** Replays cannot be watched using the Linux version of StarCraft II. Please use either the Mac or Windows version of the StarCraft II client.\n\n## Citing universalMARL \n\nIf you use universalMARL in your research, please cite the [universalMARL paper].\n\n\u003c!-- *M. Samvelyan, T. Rashid, C. Schroeder de Witt, G. Farquhar, N. Nardelli, T.G.J. Rudner, C.-M. Hung, P.H.S. Torr, J. Foerster, S. Whiteson. The StarCraft Multi-Agent Challenge, CoRR abs/1902.04043, 2019.*\n\nIn BibTeX format:\n\n```tex\n@article{samvelyan19smac,\n  title = {{The} {StarCraft} {Multi}-{Agent} {Challenge}},\n  author = {Mikayel Samvelyan and Tabish Rashid and Christian Schroeder de Witt and Gregory Farquhar and Nantas Nardelli and Tim G. J. Rudner and Chia-Man Hung and Philiph H. S. Torr and Jakob Foerster and Shimon Whiteson},\n  journal = {CoRR},\n  volume = {abs/1902.04043},\n  year = {2019},\n}\n``` --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianlin0420%2Fhgap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristianlin0420%2Fhgap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianlin0420%2Fhgap/lists"}