{"id":13481029,"url":"https://github.com/annamalai-nr/subgraph2vec_tf","last_synced_at":"2025-03-27T11:31:36.214Z","repository":{"id":85415459,"uuid":"106036558","full_name":"annamalai-nr/subgraph2vec_tf","owner":"annamalai-nr","description":"This repository contains the TensorFlow implemtation of subgraph2vec (KDD MLG 2016) paper","archived":false,"fork":false,"pushed_at":"2017-10-13T05:10:51.000Z","size":2755,"stargazers_count":26,"open_issues_count":2,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-23T13:35:39.470Z","etag":null,"topics":["deep-learning","deep-neural-networks","graph-kernels","kdd","kernel-methods","skipgram","tensorflow"],"latest_commit_sha":null,"homepage":"https://sites.google.com/site/subgraph2vec/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/annamalai-nr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-10-06T18:18:56.000Z","updated_at":"2024-02-18T02:24:05.000Z","dependencies_parsed_at":"2023-03-07T03:01:07.740Z","dependency_job_id":null,"html_url":"https://github.com/annamalai-nr/subgraph2vec_tf","commit_stats":null,"previous_names":["annamalai-nr/subgraph2vec_tf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annamalai-nr%2Fsubgraph2vec_tf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annamalai-nr%2Fsubgraph2vec_tf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annamalai-nr%2Fsubgraph2vec_tf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annamalai-nr%2Fsubgraph2vec_tf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/annamalai-nr","download_url":"https://codeload.github.com/annamalai-nr/subgraph2vec_tf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221810828,"owners_count":16884201,"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":["deep-learning","deep-neural-networks","graph-kernels","kdd","kernel-methods","skipgram","tensorflow"],"created_at":"2024-07-31T17:00:47.843Z","updated_at":"2024-10-30T14:31:14.289Z","avatar_url":"https://github.com/annamalai-nr.png","language":"Python","funding_links":[],"categories":["Factorization"],"sub_categories":[],"readme":"# subgraph2vec\n\nThis repository contains the \"tensorflow\" implementation of our paper \"subgraph2vec: Learning Distributed Representations of Rooted Sub-graphs from Large Graphs\". \nThe paper could be found at: https://arxiv.org/pdf/1606.08928.pdf \n\n\n#### Dependencies\nThis code is developed in python 2.7. It is ran and tested on Ubuntu 14.04 and 16.04.\nIt uses the following python packages:\n1. tensorflow (version == 0.12.1)\n2. networkx (version \u003c= 1.11)\n3. joblib (version \u003c= 0.11)\n4. scikit-learn (+scipy, +numpy)\n\n#####  The procedure for setting up subgraph2vec is as follows:\n\t1. git clone the repository (command: git clone https://github.com/MLDroid/subgraph2vec_tf.git )\n\t2. untar the data.tar.gz tarball\n\n#####  The procedure for obtaining rooted subgraph vectors using subgraph2vec and performing graph classification is as follows:\n\t1. move to the folder \"src\" (command: cd src) (also make sure that kdd 2015 paper's (Deep Graph Kernels) datasets are available in '../data/kdd_datasets/dir_graphs/')\n\t2. run main.py --corpus \u003cdataset of graph files\u003e --class_labels_file_name \u003cfile containing class labels of graphs to be used for graph classification\u003e file to:\n\t\t*Generate the weisfeiler-lehman kernel's rooted subgraphs from all the graphs \n\t\t*Train skipgram model to learn subgraph embeddings. The same will be dumped in ../embeddings/ folder\n\t\t*Perform graph classification using graph kernel and deep graph kernel\n\t3. example: \n\t\t*python main.py --corpus ../data/kdd_datasets/mutag --class_labels_file_name ../data/kdd_datasets/mutag.Labels \n\t\t*python main.py --corpus ../data/kdd_datasets/proteins --class_labels_file_name ../data/kdd_datasets/proteins.Labels --batch_size 16 --embedding_size 128 --num_negsample 5\n\t\n\n#### Other command line args:\n\toptional arguments:\n\t\t-h, --help            show this help message and exit\n\t\t-c CORPUS, --corpus CORPUS\n\t\t\t\t        Path to directory containing graph files to be used\n\t\t\t\t        for graph classification or clustering\n\t\t-l CLASS_LABELS_FILE_NAME, --class_labels_file_name CLASS_LABELS_FILE_NAME\n\t\t\t\t        File name containg the name of the sample and the\n\t\t\t\t        class labels\n\t\t-o OUTPUT_DIR, --output_dir OUTPUT_DIR\n\t\t\t\t        Path to directory for storing output embeddings\n\t\t-b BATCH_SIZE, --batch_size BATCH_SIZE\n\t\t\t\t        Number of samples per training batch\n\t\t-e EPOCHS, --epochs EPOCHS\n\t\t\t\t        Number of iterations the whole dataset of graphs is\n\t\t\t\t        traversed\n\t\t-d EMBEDDING_SIZE, --embedding_size EMBEDDING_SIZE\n\t\t\t\t        Intended subgraph embedding size to be learnt\n\t\t-neg NUM_NEGSAMPLE, --num_negsample NUM_NEGSAMPLE\n\t\t\t\t        Number of negative samples to be used for training\n\t\t-lr LEARNING_RATE, --learning_rate LEARNING_RATE\n\t\t\t\t        Learning rate to optimize the loss function\n\t\t--n_cpus N_CPUS       Maximum no. of cpu cores to be used for WL kernel\n\t\t\t\t        feature extraction from graphs\n\t\t--wlk_h WLK_H         Height of WL kernel (i.e., degree of rooted subgraph\n\t\t\t\t        features to be considered for representation learning)\n\t\t-lf LABEL_FILED_NAME, --label_filed_name LABEL_FILED_NAME\n\t\t\t\t        Label field to be used for coloring nodes in graphs\n\t\t\t\t        using WL kenrel\n\t\t-v VALID_SIZE, --valid_size VALID_SIZE\n\t\t\t\t        Number of samples to validate training process from\n\t\t\t\t        time to time\n\n## Contact ##\nIn case of queries, please email: annamala002@e.ntu.edu.sg OR XZHANG048@e.ntu.edu.sg\n\n#### Reference \n\n\tPlease consider citing the follow paper when you use this code.\n\t@article{narayanansubgraph2vec,\n\t  title={subgraph2vec: Learning Distributed Representations of Rooted Sub-graphs from Large Graphs},\n\t  author={Narayanan, Annamalai and Chandramohan, Mahinthan and Chen, Lihui and Liu, Yang and Saminathan, Santhoshkumar}\n\t}\n\n## Acknowledgements ##\nThanks to Zhang Xinyi (https://github.com/XinyiZ001) for the support on coding/testing subgraph2vec TF version.\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannamalai-nr%2Fsubgraph2vec_tf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannamalai-nr%2Fsubgraph2vec_tf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannamalai-nr%2Fsubgraph2vec_tf/lists"}