{"id":16056574,"url":"https://github.com/pbielak/gerf","last_synced_at":"2025-07-25T05:37:19.924Z","repository":{"id":68802772,"uuid":"477468806","full_name":"pbielak/gerf","owner":"pbielak","description":"Official implementation of the Graph Embedding RetroFitting (GERF) method","archived":false,"fork":false,"pushed_at":"2022-08-24T10:13:55.000Z","size":513,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-03T09:42:31.006Z","etag":null,"topics":["attributed-graphs","graph-embedding","retrofitting"],"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/pbielak.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":"2022-04-03T21:21:29.000Z","updated_at":"2024-12-30T13:21:42.000Z","dependencies_parsed_at":"2023-02-24T07:15:49.336Z","dependency_job_id":null,"html_url":"https://github.com/pbielak/gerf","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/pbielak%2Fgerf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbielak%2Fgerf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbielak%2Fgerf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbielak%2Fgerf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pbielak","download_url":"https://codeload.github.com/pbielak/gerf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240190806,"owners_count":19762583,"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":["attributed-graphs","graph-embedding","retrofitting"],"created_at":"2024-10-09T03:00:26.251Z","updated_at":"2025-02-22T14:39:26.030Z","avatar_url":"https://github.com/pbielak.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graph Embedding RetroFitting (GERF)\nThis repository provides the official implementation of the Graph Embedding Retrofitting method,\nwhich was introduced in the *Retrofitting structural graph embeddings with node attribute information*\npaper. It also includes the whole experimental pipeline which is built using DVC.\n\n![](assets/graph-embedding-retrofitting.png)\n\n\n### How to use?\n- create and activate virtual environment (`venv`)\n- install dependencies (`pip install -r requirements.txt`)\n- *pull all files from the DVC remote (`dvc pull`)\n\n(*) The whole pipeline should be reproducible without any external data dependencies.\nIf you want to use precomputed stage outputs, please perform the `dvc pull` command\nand it will download all stage artifacts into the `data/` directory. You don't\nneed any credentials as a public DVC remote endpoint is used in the DVC configuration\nfile. The total size of all artifacts is about 20GB.\n\nIf you want to use Docker instead of virtual environments, this repo contains also\na ready-to-use Dockerfile:\n```bash\ndocker build -t gerf:latest -f docker/Dockerfile .\n\n./docker/run-docker-gpu.sh \"\u003cgpu-id\u003e\"\n```\n\n## Training \u0026 evaluation\nWe implement all our models using the PyTorch-Geometric library and use DVC\n(Data Version Control) for model versioning. DVC enables to run all experiments\nin a single command and ensure better reproducibility. To reproduce the whole\npipeline run: `dvc repro` and to execute a single stage use: `dvc repro -f -s \u003cstage name\u003e`\n\nThere are following stages (see `dvc.yaml` file):\n- `embed_node2vec@\u003cdataset_name\u003e` – uses the Node2vec method for computing structural node embeddings,\n- `embed_line@\u003cdataset_name\u003e` – uses the LINE method for computing structural node embeddings,\n- `embed_sdne@\u003cdataset_name\u003e` – uses the SDNE method for computing structural node embeddings,\n- `embed_tadw@\u003cdataset_name\u003e` – uses the TADW method for computing attributed node embeddings,\n- `embed_fscnmf@\u003cdataset_name\u003e` – uses the FSCNMF method for computing attributed node embeddings,\n- `embed_dgi@\u003cdataset_name\u003e` – uses the DGI method for computing attributed node embeddings,\n- `apply_concat_refiner@\u003cdataset_name\u003e` – computes node embeddings as the naive concatenation of structural embeddings and node attributes,\n- `apply_concat_pca_refiner@\u003cdataset_name\u003e` – similar to the above, but applies PCA to the resulting embedding vectors,\n- `apply_mlp_refiner@\u003cdataset_name\u003e` – computes node embeddings as an MLP applied on the structural embeddings and node attributes,\n- `hps_GERF@\u003cdataset_name\u003e` – runs the grid search over GERF's hyperparameters,\n- `apply_GERF@\u003cdataset_name\u003e` – computes node embeddings using our proposed GERF method,\n- `evaluate_node_classification@\u003cdataset_name\u003e` – evaluates node embeddings (specified in the configuration file) in a node classification task,\n- `make_report_tables` - summarizes node classification performance into a single table,\n- `make_hps_plot@\u003cdataset_name\u003e` - prepares a visualization of the hyperparameter grid search.\n\n\nAll hyperparameters are stored in configuration files in the `experiments/configs/`\ndirectory, whereas the experimental Python scripts are placed in the `experiments/scripts/` directory.\n\n## Reference\nIf you make use GERF in your research, please cite it using the following entry:\n\n```\n@InProceedings{10.1007/978-3-031-08751-6_13,\nauthor=\"Bielak, Piotr and Puchalska, Daria and Kajdanowicz, Tomasz\",\ntitle=\"Retrofitting Structural Graph Embeddings with Node Attribute Information\",\nbooktitle=\"Computational Science -- ICCS 2022\",\nyear=\"2022\",\neditor=\"Groen, Derek and de Mulatier, Cl{\\'e}lia and Paszynski, Maciej and Krzhizhanovskaya, Valeria V. and Dongarra, Jack J. and Sloot, Peter M. A.\",\npublisher=\"Springer International Publishing\",\naddress=\"Cham\",\npages=\"178--191\",\nisbn=\"978-3-031-08751-6\"\n}\n```\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpbielak%2Fgerf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpbielak%2Fgerf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpbielak%2Fgerf/lists"}