Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliang-CN committed Jul 10, 2020
1 parent 932888a commit 886c1b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ def train_model(network_data, feature_dic, log_name):

# Input data
train_inputs = tf.placeholder(tf.int32, shape=[None]) # x node
train_labels = tf.placeholder(tf.int32, shape=[None, 1]) # y node
train_types = tf.placeholder(tf.int32, shape=[None]) # layer
train_labels = tf.placeholder(tf.int32, shape=[None, 1]) # y node walk之后窗口内的相邻的节点
train_types = tf.placeholder(tf.int32, shape=[None]) # layer 边属性
node_neigh = tf.placeholder(tf.int32, shape=[None, edge_type_count, neighbor_samples]) # x node 对应的neighbor

# Look up embeddings for nodes
if feature_dic is not None:
node_embed = tf.nn.embedding_lookup(node_features, train_inputs)
node_embed = tf.matmul(node_embed, embed_trans) # shape=(b, embedding_size)
if feature_dic is not None: # 节点有特征就把节点特征压缩到embedding维度上,如果没有就用一个embedding维度向量表示
node_embed = tf.nn.embedding_lookup(node_features, train_inputs) # shape=(b, feature_dim)
node_embed = tf.matmul(node_embed, embed_trans) # shape=(b, embedding_size) 把节点的属性特征压缩到embedding维度上
else:
node_embed = tf.nn.embedding_lookup(node_embeddings, train_inputs)

node_embed = tf.nn.embedding_lookup(node_embeddings, train_inputs) # 如果没有节点特征属性,就直接把节点属性用一个embedding维度的向量来表示
#
if feature_dic is not None:
node_embed_neighbors = tf.nn.embedding_lookup(node_features, node_neigh) # shape=(b, edge_type_count, neighbor_samples, feature_dim)
node_embed_tmp = tf.concat([tf.matmul(
Expand Down

0 comments on commit 886c1b0

Please sign in to comment.