• Stars
    star
    3,660
  • Rank 11,986 (Top 0.3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 5 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Implementation and experiments of graph embedding algorithms.

GraphEmbedding

GitHub Issues CI status codecov Codacy Badge Disscussion

Method

Model Paper Note
DeepWalk [KDD 2014]DeepWalk: Online Learning of Social Representations 【Graph Embedding】DeepWalk:算法原理,实现和应用
LINE [WWW 2015]LINE: Large-scale Information Network Embedding 【Graph Embedding】LINE:算法原理,实现和应用
Node2Vec [KDD 2016]node2vec: Scalable Feature Learning for Networks 【Graph Embedding】Node2Vec:算法原理,实现和应用
SDNE [KDD 2016]Structural Deep Network Embedding 【Graph Embedding】SDNE:算法原理,实现和应用
Struc2Vec [KDD 2017]struc2vec: Learning Node Representations from Structural Identity 【Graph Embedding】Struc2Vec:算法原理,实现和应用

How to run examples

  1. clone the repo and make sure you have installed tensorflow or tensorflow-gpu on your local machine.
  2. run following commands
python setup.py install
cd examples
python deepwalk_wiki.py

DisscussionGroup & Related Projects

公众号:浅梦学习笔记

微信:deepctrbot

Usage

The design and implementation follows simple principles(graph in,embedding out) as much as possible.

Input format

we use networkxto create graphs.The input of networkx graph is as follows: node1 node2 <edge_weight>

DeepWalk

G = nx.read_edgelist('../data/wiki/Wiki_edgelist.txt',create_using=nx.DiGraph(),nodetype=None,data=[('weight',int)])# Read graph

model = DeepWalk(G,walk_length=10,num_walks=80,workers=1)#init model
model.train(window_size=5,iter=3)# train model
embeddings = model.get_embeddings()# get embedding vectors

LINE

G = nx.read_edgelist('../data/wiki/Wiki_edgelist.txt',create_using=nx.DiGraph(),nodetype=None,data=[('weight',int)])#read graph

model = LINE(G,embedding_size=128,order='second') #init model,order can be ['first','second','all']
model.train(batch_size=1024,epochs=50,verbose=2)# train model
embeddings = model.get_embeddings()# get embedding vectors

Node2Vec

G=nx.read_edgelist('../data/wiki/Wiki_edgelist.txt',
                        create_using = nx.DiGraph(), nodetype = None, data = [('weight', int)])#read graph

model = Node2Vec(G, walk_length = 10, num_walks = 80,p = 0.25, q = 4, workers = 1)#init model
model.train(window_size = 5, iter = 3)# train model
embeddings = model.get_embeddings()# get embedding vectors

SDNE

G = nx.read_edgelist('../data/wiki/Wiki_edgelist.txt',create_using=nx.DiGraph(),nodetype=None,data=[('weight',int)])#read graph

model = SDNE(G,hidden_size=[256,128]) #init model
model.train(batch_size=3000,epochs=40,verbose=2)# train model
embeddings = model.get_embeddings()# get embedding vectors

Struc2Vec

G = nx.read_edgelist('../data/flight/brazil-airports.edgelist',create_using=nx.DiGraph(),nodetype=None,data=[('weight',int)])#read graph

model = Struc2Vec(G, 10, 80, workers=4, verbose=40, ) #init model
model.train(window_size = 5, iter = 3)# train model
embeddings = model.get_embeddings()# get embedding vectors

More Repositories

1

DeepCTR

Easy-to-use,Modular and Extendible package of deep-learning based CTR models .
Python
7,504
star
2

DeepCTR-Torch

【PyTorch】Easy-to-use,Modular and Extendible package of deep-learning based CTR models.
Python
2,952
star
3

DeepMatch

A deep matching model library for recommendations & advertising. It's easy to train models and to export representation vectors which can be used for ANN search.
Python
2,207
star
4

AlgoNotes

【浅梦学习笔记】文章汇总:包含 排序&CXR预估,召回匹配,用户画像&特征工程,推荐搜索综合 计算广告,大数据,图算法,NLP&CV,求职面试 等内容
1,548
star
5

Coursera

Quiz & Assignment of Coursera
Jupyter Notebook
867
star
6

GraphNeuralNetwork

Implementation and experiments of graph neural netwokrs, like gcn,graphsage,gat,etc.
Python
781
star
7

coding_interviews

《剑指Offer》题目汇总&常考题总结(Python实现)
Python
457
star
8

DSIN

Code for the IJCAI'19 paper "Deep Session Interest Network for Click-Through Rate Prediction"
Python
431
star
9

Tencent_Social_Ads2017_Mobile_App_pCVR

Tencent Social Ads 2017 contest rank 20
Jupyter Notebook
157
star
10

Bytedance_ICME2019_challenge_baseline

Bytedance_ICME2019_challenge_baseline
Python
144
star
11

IJCAI_2018_Competition_baseline

IJCAI2018阿里妈妈搜索广告转化率预估baseline LB 0.0831
Python
88
star
12

ctrip14

科赛 携程出行产品未来14个月销量预测 第2名
Jupyter Notebook
62
star
13

ReinforcementLearning

This project contains several Deep Reinforcement Learning method and some experiments basd on OpenAi gym.
Python
19
star
14

Machine-Learning-in-Action

《机器学习实战》练习代码
Python
8
star
15

shenweichen

5
star
16

edX

edX Assignment
Jupyter Notebook
4
star
17

Book-information-management-system-based-on-OneThink

Book information management system based on OneThink
JavaScript
4
star
18

OpenGL-simulation-shortest-path-of-3D-space

OpenGL shortest path
C
3
star
19

StanfordOnline

StanfordOnline mooc
Jupyter Notebook
2
star