Relation-Network-Tensorflow
Relation-Network-Tensorflow copied to clipboard
slow graph building when d value if big
In the file model_rn.py, can we have a better way to implement this double for loop? to speedup graph generation.
for i in range(d*d):
o_i = conv_4[:, int(i / d), int(i % d), :]
o_i = concat_coor(o_i, i, d)
for j in range(d*d):
o_j = conv_4[:, int(j / d), int(j % d), :]
o_j = concat_coor(o_j, j, d)
if i == 0 and j == 0:
g_i_j = g_theta(o_i, o_j, q, reuse=False)
else:
g_i_j = g_theta(o_i, o_j, q, reuse=True)
all_g.append(g_i_j)