{"id":21158975,"url":"https://github.com/xptree/netsmf","last_synced_at":"2025-07-09T13:34:13.675Z","repository":{"id":36054164,"uuid":"172439828","full_name":"xptree/NetSMF","owner":"xptree","description":"NetSMF: Large-Scale Network Embedding as Sparse Matrix Factorization","archived":false,"fork":false,"pushed_at":"2022-05-05T19:44:04.000Z","size":60,"stargazers_count":128,"open_issues_count":4,"forks_count":24,"subscribers_count":8,"default_branch":"master","last_synced_at":"2023-10-20T23:53:40.937Z","etag":null,"topics":["network-embedding","social-network-analysis","webconf"],"latest_commit_sha":null,"homepage":null,"language":"C++","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/xptree.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":"2019-02-25T05:25:52.000Z","updated_at":"2023-07-04T08:46:15.000Z","dependencies_parsed_at":"2022-09-16T14:51:11.234Z","dependency_job_id":null,"html_url":"https://github.com/xptree/NetSMF","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xptree%2FNetSMF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xptree%2FNetSMF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xptree%2FNetSMF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xptree%2FNetSMF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xptree","download_url":"https://codeload.github.com/xptree/NetSMF/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225556829,"owners_count":17487927,"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":["network-embedding","social-network-analysis","webconf"],"created_at":"2024-11-20T12:41:04.084Z","updated_at":"2024-11-20T12:41:04.804Z","avatar_url":"https://github.com/xptree.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NetSMF\n\nNetSMF: Large-Scale Network Embedding as Sparse Matrix Factorization [[arxiv](https://arxiv.org/abs/1906.11156)]\n\nPlease cite our paper if you use this code in your own work:\n\n```\n@inproceedings{qiu2019netsmf,\n author = {Qiu, Jiezhong and Dong, Yuxiao and Ma, Hao and Li, Jian and Wang, Chi and Wang, Kuansan and Tang, Jie},\n title = {NetSMF: Large-Scale Network Embedding As Sparse Matrix Factorization},\n booktitle = {The World Wide Web Conference},\n series = {WWW '19},\n year = {2019},\n publisher = {ACM}\n} \n```\n\n# HOWTO\n\n## How to install\n```\nsudo apt-get install cmake\nsudo apt-get install libgflags-dev\nsudo apt-get install liblog4cxx-dev\nsudo apt-get install libomp-dev\nsudo apt-get install libeigen3-dev\nhttps://github.com/xptree/NetSMF.git\ncd NetSMF\nmkdir build\n./configure\ncd build\nmake\n```\n\nThe dependence versions that the code is tested:\n\n| Dependence \t| Version     \t|\n|------------\t|-------------\t|\n| g++        \t| 5.4.0       \t|\n| cmake      \t| 3.5.1-1     \t|\n| gflags     \t| 2.1.2-3     \t|\n| log4cxx    \t| 0.10.0-10   \t|\n| openmp     \t| 3.7.0-3     \t|\n| eigen3     \t| 3.3~beta1-2 \t|\n\n**Note: Using eigen3 3.2.5 may cause problems. Please do update you eigen3 to 3.3 or above.**\n\n## How to run\n\n### Input\n\nSupport undirected networks with edgelist format.\n\nFor unweighted networks, each edge should appear twice `a b` and `b a`.\n\nFor weighted networks, each edge should appear twice `a b w` and `b a w`.\n\nYou may want to use `example/mat2edge.py` to translate mat to edgelist.\n\n`.mat` files can be downloaded here:\n\n* BlogCatalog [Source](http://socialcomputing.asu.edu/datasets/BlogCatalog3) [Preprocessed](http://leitang.net/code/social-dimension/data/blogcatalog.mat)\n* Protein-Protein Interaction [Source](http://thebiogrid.org/download.php) [Preprocessed](http://snap.stanford.edu/node2vec/Homo_sapiens.mat)\n* [Flickr](http://leitang.net/code/social-dimension/data/flickr.mat)\n* [YouTube](http://leitang.net/code/social-dimension/data/youtube.mat)\n\n\n\n### Run NetSMF\n\nFor unweighted networks, see `example/blog.sh` for an example.\n\n`blog.sh` takes three arguments, the first one indicates the input edgelist file, the second one indicates the output file, the third one indicating the origin `.mat` file containing network and labels.\n\nFor exmaple, runing `./blog.sh blogcatalog.edgelist blogcatalog.netsmf blogcatalog.mat` will\n\n* check if `blogcatalog.edgelist` is a valid file. If not, it calls `mat2edge.py` to translate mat file `blogcatalog.mat` to edgelist `blogcatalog.edgelist`.\n* call NetSMF algorithm, and store the 128-dim embedding at `blogcatalog.netsmf_128.npy`.\n* call `predict.py` to evaluate NetSMF at the label classification task.\n\nYou can use `-weight` to switch to weighted networks and use `-noweight` to switch to unweighted network (default unweighted).\n\n### About truncated logarithm\n\nWe propose to use truncated logarithm in our WWW'19 paper.\n\nIn the code, we provide a new option `log1p`, i.e., `log(1+x)`. You can use  `-log1p` to turn it on and `-nolog1p` to turn it off (default off). Empirically speaking, `log1p` sometimes achieves better performance, for example in wiki dataset.\n\n\n## Acknowledgement\n\nThe implementation of randomized singular value decomposition is by [redsvd](https://code.google.com/p/redsvd/) and [HPCA](https://github.com/idiap/hpca).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxptree%2Fnetsmf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxptree%2Fnetsmf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxptree%2Fnetsmf/lists"}