{"id":18401707,"url":"https://github.com/borealisai/oos-kge","last_synced_at":"2025-07-20T14:33:02.702Z","repository":{"id":41446774,"uuid":"300429500","full_name":"BorealisAI/OOS-KGE","owner":"BorealisAI","description":"PyTorch code of “Out-of-Sample Representation Learning for Multi-Relational Graphs” (EMNLP 2020)","archived":false,"fork":false,"pushed_at":"2020-10-02T14:41:08.000Z","size":6451,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-04-18T03:18:37.189Z","etag":null,"topics":["emnlp2020","knowledge-graph","machine-learning","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BorealisAI.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":"2020-10-01T21:27:15.000Z","updated_at":"2024-02-03T16:15:07.000Z","dependencies_parsed_at":"2022-08-25T13:31:03.002Z","dependency_job_id":null,"html_url":"https://github.com/BorealisAI/OOS-KGE","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/BorealisAI%2FOOS-KGE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorealisAI%2FOOS-KGE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorealisAI%2FOOS-KGE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorealisAI%2FOOS-KGE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BorealisAI","download_url":"https://codeload.github.com/BorealisAI/OOS-KGE/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223274434,"owners_count":17118002,"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":["emnlp2020","knowledge-graph","machine-learning","pytorch"],"created_at":"2024-11-06T02:39:42.257Z","updated_at":"2024-11-06T02:39:42.707Z","avatar_url":"https://github.com/BorealisAI.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Out-of-Sample Representation Learning for Multi-Relational Graphs\n\nThis repo containts the PyTorch implementation of the model presented in [Out-of-Sample Representation Learning for Multi-Relational Graphs](https://arxiv.org/pdf/2004.13230.pdf) accepted to findings of EMNLP 2020.\n\n## Dependencies\n\n* `Python` version 3.6\n* `Numpy` version 1.16.0\n* `PyTorch` version 1.5.0\n\n\n## Running a model\n\nTo train the model run `python main.py` from the `src` directory, but first you need to specify a few parameters.\n\nHere is a list of important parameters:\n```\n-dataset            \tdataset to use (WN18RR or FB15K-237)\n-model_name         \tembedding model (currently only DisMult is supported)\n-emb_method         \taggregation functions to compute unobserved representations\n-mask_prob              The probability of observed entities (equivalent to (1-psi) in the paper)\n-opt                \toptimizer to use. Currenty only adagrad and adam are supported\n-lr                     learning rate\n-reg_lambda         \tl2 regularization parameter\n-reg_ls             \tl2 regularization parameter for least square\n-ne                 \tnumber of epochs\n-save_each          \tvalidation frequency\n-batch_size         \tbatch size\n-simulated_batch_size   batch size to be simulated\n-neg_ratio          \tnumber of negative examples per positive example\n```\n\n\n## Reproducing the Results in the Paper\n\nTo reproduce results of `oDistMult-ERAvg` models, run the following commands.\n\n### WN18RR dataset\n\n```bash\npython main.py -dataset \"WN18RR\" -model_name \"DisMult\" -emb_method \"ERAverage\" -mask_prob 0.5 -ne 1000 -lr 0.1 -reg_lambda 0.01  -emb_dim 200 -neg_ratio 1 -batch_size 250 -simulated_batch_size 1000 -save_each 100\n```\n\n\n### FB15K-237\n\n```bash\npython main.py -dataset \"FB15k-237\" -model_name \"DisMult\" -emb_method \"ERAverage\" -mask_prob 0.5 -ne 1000 -lr 0.01 -reg_lambda 0.0001  -emb_dim 200 -neg_ratio 1 -batch_size 250 -simulated_batch_size 1000 -save_each 100\n```\n\n\n## Cite\n\nIf you found this codebase or our work useful, please cite:\n```text\n@article{albooyeh2020out,\n  title={Out-of-Sample Representation Learning for Multi-Relational Graphs},\n  author={Albooyeh, Marjan and Goel, Rishab and Kazemi, Seyed Mehran},\n  journal={arXiv preprint arXiv:2004.13230},\n  year={2020}\n}\n```\n\n\n## License\n\nLicensed under Creative Commons Attribution-NonCommercial-ShareALike (CC BY-NC-SA). For more information please read\nhttps://creativecommons.org/licenses/by-nc-sa/4.0/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborealisai%2Foos-kge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborealisai%2Foos-kge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborealisai%2Foos-kge/lists"}