{"id":48568786,"url":"https://github.com/ml-research/cna_modules","last_synced_at":"2026-04-08T13:33:28.152Z","repository":{"id":260128625,"uuid":"880343488","full_name":"ml-research/cna_modules","owner":"ml-research","description":"Cluster-Normalize-Activate Modules","archived":false,"fork":false,"pushed_at":"2025-01-13T17:39:04.000Z","size":2293,"stargazers_count":12,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-05T00:21:52.713Z","etag":null,"topics":["graph-neural-networks","machine-learning","neurips-2024","paper"],"latest_commit_sha":null,"homepage":"","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/ml-research.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-29T14:56:31.000Z","updated_at":"2025-08-01T06:52:29.000Z","dependencies_parsed_at":"2025-04-12T18:30:43.413Z","dependency_job_id":"579ad9c5-9ed6-4695-8d6f-b46c0fd1677d","html_url":"https://github.com/ml-research/cna_modules","commit_stats":null,"previous_names":["ml-research/cna_modules"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ml-research/cna_modules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-research%2Fcna_modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-research%2Fcna_modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-research%2Fcna_modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-research%2Fcna_modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ml-research","download_url":"https://codeload.github.com/ml-research/cna_modules/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-research%2Fcna_modules/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31558383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","machine-learning","neurips-2024","paper"],"created_at":"2026-04-08T13:33:27.324Z","updated_at":"2026-04-08T13:33:28.136Z","avatar_url":"https://github.com/ml-research.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# CNA-Modules\n\nOfficial code for the paper *Graph Neural Networks Need Cluster-Normalize-Activate Modules* accepted at NeurIPS 2024.\n\n[![NeurIPS 2024 Poster](https://img.shields.io/badge/NeurIPS%202024-Poster-blue)](https://neurips.cc/virtual/2024/poster/94196)\n[![arXiv](https://img.shields.io/badge/arXiv-2412.04064-b31b1b)](https://arxiv.org/abs/2412.04064)\n\n![alt text](images/cna_robots.png \"CNA-Modules\")\n\n## Installation\n### Dockerfile\nWe provide a `Dockerfile` for ease of reproducibility. See the Docker Docs on [How to get started](https://docs.docker.com/guides/get-started/).\n\n### Via installation script\nNavigate into the directory `cna_modules`.\nThen execute the following command to make the script executable:\n```bash\nchmod +x install_script.sh\n```\n\nAfter that, execute the script via:\n```bash\nbash -i install_script.sh\n```\n\nWhen the script is executed successfully, activate the conda environment via:\n```bash\nconda activate cluster-normalize-activate\n```\n\n### Via conda environment\nTo install the necessary libraries, you can create a conda environment using the following command:\n\n```\nconda env create -f environment.yml\n```\n\nThe required libraries are saved in the `environment.yml` file. After the installation is complete, activate the environment with the following command:\n\n```\nconda activate cna-modules\n```\n\nAlternatively, you can run the following command to install:\n\n```\nmake install\n```\n\n## Project Structure\n\nThe Python scripts can be found in the `src` directory, and the figures are located in the `images` directory.\n\n## Usage\n\nTo use the project, navigate to the `~/cna_modules/src` directory and run the appropriate script.\n\n```\npython scripts/execute_experiments.py\n```\n\nTo adapt the parameters, open the file `model_params.py` in the `utils` directory, \nand you can here see the possible options to choose or adapt:\n\n```\nexperiment_number = ...  # number of experiment\nepochs = [...]  # number of epochs (list)\nmodel_type = ...  # to define the model type\nnum_hidden_features = [...]  # number of hidden features (list)\nlr_model = [...]  # learning rate for the model (list)\nlr_activation = [...]  # learning rate for the activations (list)\nweight_decay = [...]  # weight decay for both (list)\nclusters = [...]  # number of clusters (list)\nnum_layers = [...]  # number of layers (list)\nnum_activation = [...]  # number of activations inside RPM (list)\nn = ...  # numerator\nm = ...  # denominator\nrecluster_option = ...\nactivation_type = [...]  # activation type (list)\nmode = [...]  # distance metric type (list)\nwith_clusters = [...]  # flag for clustering (list)\nuse_coefficients = ...  # flag for use of coefficients in our Rationals\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n# Types: Planetoid, CitationFull, Amazon, WikipediaNetwork, WebKB\n# name of the dataset (Cora, CiteSeer, PubMed, Cora_ML, chameleon, Photo etc.)\nset_dataset = ...  # here to set the dataset\ntask_type = ...  # here to set the task type\n```\n\nBut you can also use the predefined configurations as listed in the directory `utlis/configs`. \nTo execute an experiment this way you can run:\n```\npython scripts/execute_experiments.py --config [name of configuration] --num_seeds [num of seeds]\n```\nAn excerpt from all accessible configurations: \n\nCiteSeer (Node Classification):\n```text\nciteseer_4_gatconv \nciteseer_2_gcnconv\nciteseer_4_gcnconv \nciteseer_8_gcnconv \nciteseer_16_gcnconv\nciteseer_32_gcnconv\nciteseer_64_gcnconv \n```\nCora (Node Classification):\n```text\ncora_4_sageconv\ncora_2_gcnconv \ncora_4_gcnconv \ncora_8_gcnconv\ncora_16_gcnconv\ncora_32_gcnconv \ncora_64_gcnconv\ncora_96_gcnconv \ncorafull_2_transformerconv\n```\nOthers (Node Classification):\n```text\nsquirrel_2_dirgcnconv\ncomputers_2_transformerconv\nchameleon_2_dirgcnconv \ntexas_2_sageconv \nwisconsin_2_transformerconv \ndblp_4_transformerconv \nphoto_4_transformerconv\npubmed_2_transformerconv\n```\nOgbn-arxiv (Node Property Prediction):\n```text\nogbn-arxiv_4_nodeproppred_sageconv \nogbn-arxiv_4_nodeproppred_gcnconv \n```\nOthers (Node Regression):\n```text\nchameleon_2_node_regression_transformerconv \nsquirrel_2_node_regression_transformerconv\n``` \nWe ask you kindly to have a look at `src/utils/configs/` to explore other options.\n\n## Contributors\n\n- [Arseny Skryagin](https://github.com/askrix/), [Felix Divo](https://felix.divo.link/), [Amin Ali](https://github.com/MAminAli)\n\n## How to cite\n```latex\n@inproceedings{Skryagin_Graph_Neural_Networks_2024,\n    author = {Skryagin, Arseny and Divo, Felix and Ali, Mohammad Amin and Dhami, Devendra Singh and Kersting, Kristian},\n    month = dec,\n    series = {The Thirty-eighth Annual Conference on Neural Information Processing Systems},\n    title = {{Graph Neural Networks Need Cluster-Normalize-Activate Modules}},\n    url = {https://openreview.net/forum?id=faj2EBhdHC},\n    year = {2024}\n}\n```\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fml-research%2Fcna_modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fml-research%2Fcna_modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fml-research%2Fcna_modules/lists"}