未验证 提交 9726da54 编写于 作者: H hutuxian 提交者: GitHub

add transpose for connection matrix and update network (#1953)

上级 89f78b0a
......@@ -168,7 +168,7 @@ def network(batch_size, items_num, hidden_size, step):
global_attention = layers.reduce_sum(weight_mask, dim=1)
final_attention = layers.concat(
[global_attention, last_fc], axis=1) #[batch_size, 2*h]
[global_attention, last], axis=1) #[batch_size, 2*h]
final_attention_fc = layers.fc(
input=final_attention,
name="fina_attention_fc",
......
......@@ -57,13 +57,11 @@ class Data():
u_deg_in = np.sum(adj, 0)
u_deg_in[np.where(u_deg_in == 0)] = 1
adj_in.append(
np.divide(adj, u_deg_in)
) #maybe should add a transpose, but the result shows no difference
adj_in.append(np.divide(adj, u_deg_in).transpose())
u_deg_out = np.sum(adj, 1)
u_deg_out[np.where(u_deg_out == 0)] = 1
adj_out.append(np.divide(adj.transpose(), u_deg_out))
adj_out.append(np.divide(adj.transpose(), u_deg_out).transpose())
seq_index.append(
[np.where(node == i)[0][0] + id * max_uniq_len for i in e[0]])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册