{"id":26172466,"url":"https://github.com/jwuphysics/gnn-linking-lengths","last_synced_at":"2025-12-25T02:03:12.331Z","repository":{"id":189804795,"uuid":"681342788","full_name":"jwuphysics/gnn-linking-lengths","owner":"jwuphysics","description":"Measuring galaxy environmental distance scales with GNNs and explainable ML models","archived":false,"fork":false,"pushed_at":"2024-06-05T15:35:16.000Z","size":11885,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-05T17:43:35.256Z","etag":null,"topics":["astronomy","astrophysics","explainable-machine-learning","graph-neural-networks","shapley-additive-explanations"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2402.07995","language":"Jupyter Notebook","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/jwuphysics.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":"2023-08-21T20:00:54.000Z","updated_at":"2024-06-05T15:31:24.000Z","dependencies_parsed_at":"2023-08-21T21:23:46.262Z","dependency_job_id":"71e44623-b149-483f-8e53-68bb7b2d92ad","html_url":"https://github.com/jwuphysics/gnn-linking-lengths","commit_stats":null,"previous_names":["jwuphysics/gnn-linking-lengths"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwuphysics%2Fgnn-linking-lengths","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwuphysics%2Fgnn-linking-lengths/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwuphysics%2Fgnn-linking-lengths/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwuphysics%2Fgnn-linking-lengths/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwuphysics","download_url":"https://codeload.github.com/jwuphysics/gnn-linking-lengths/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243104090,"owners_count":20236944,"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":["astronomy","astrophysics","explainable-machine-learning","graph-neural-networks","shapley-additive-explanations"],"created_at":"2025-03-11T19:56:36.720Z","updated_at":"2025-12-25T02:03:07.299Z","avatar_url":"https://github.com/jwuphysics.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Galaxy Environment Length Scales\nAn exploration of galaxy environments in the context of the galaxy-halo connection using explainable AI and graph neural networks\n\n## Data\n\nWe make use of the `SUBFIND` snapshot 99 (redshift 0) subhalo catalogs derived from the Illustris TNG300-1 hydrodynamic and dark matter only (DMO) simulations. All data can be accessed through the [IllustrisTNG website](https://www.tng-project.org/data/).\n\n## Requirements\n\nThe most important requirements are `pytorch` and `pytorch-geometric`; check out the [latter's documentation](https://pytorch-geometric.readthedocs.io/en/latest/) for more information about installing it.\n\nTraining and interpreting the explainable boosting machine (EBM) models requires the [`interpret`](https://github.com/interpretml/interpret/) and [`shap`](https://github.com/shap/shap) packages.\n\n## Code\n\nAll of the GNN code is contained in `./src`, and the full results can be found in `./notebook/results.ipynb`. For example, if you want to train a GNN with multi-aggregation no self-loops to map dark matter only subhalo properties to galaxy stellar masses, then run:\n\n```bash\npython src/painting_galaxies.py --aggr multi --loops 0 --mode dmo\n```\n\nTraining the EBM is fairly straightforward, and you can see examples in the notebook, e.g.:\n\n```python\nebm_hyperparams = {\n    \"max_bins\": 50000, \n    \"validation_size\": 0.3,\n    \"interactions\": 32,\n}\n\nebm = ExplainableBoostingRegressor(**ebm_hyperparams)        \nebm.fit(X_train, y_train)\n\ny_pred = ebm.predict(X_valid)\n```\n\n## Citation \n\nOur paper has now been submitted to ApJ! If you use this code, please cite:\n```\n@ARTICLE{2024arXiv240207995W,\n       author = {{Wu}, John F. and {Kragh Jespersen}, Christian and {Wechsler}, Risa H.},\n        title = \"{How the Galaxy-Halo Connection Depends on Large-Scale Environment}\",\n      journal = {arXiv e-prints},\n     keywords = {Astrophysics - Astrophysics of Galaxies, Astrophysics - Cosmology and Nongalactic Astrophysics, Astrophysics - Instrumentation and Methods for Astrophysics},\n         year = 2024,\n        month = feb,\n          eid = {arXiv:2402.07995},\n        pages = {arXiv:2402.07995},\narchivePrefix = {arXiv},\n       eprint = {2402.07995},\n primaryClass = {astro-ph.GA},\n       adsurl = {https://ui.adsabs.harvard.edu/abs/2024arXiv240207995W},\n      adsnote = {Provided by the SAO/NASA Astrophysics Data System}\n}\n\n\n``` \n\n## Acknowledgments\n\nThis project was made possible by the KITP Program, [*Building a Physical Understanding of Galaxy Evolution with Data-driven Astronomy*\n](https://www.kitp.ucsb.edu/activities/galevo23) (see also the [website](https://datadrivengalaxyevolution.github.io/)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwuphysics%2Fgnn-linking-lengths","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwuphysics%2Fgnn-linking-lengths","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwuphysics%2Fgnn-linking-lengths/lists"}