In the train.py script, copied and pasted below, the first element of the tuple for the adj_list is the index of the train_triplets,
adj_list = [[] for _ in entities]
for i,triplet in enumerate(train_triplets):
adj_list[triplet[0]].append([i, triplet[2]])
adj_list[triplet[2]].append([i, triplet[0]])
Later on in the sample_edge_neighborhood method, you have the follow code to sample the edge,
The chosen_adj_list is an array of shape num_neighbors x 2, the second dimension being the tuple you're appending in the previous code block. But here, chosen_edge[0] would give you the index of the training triplet, which is not in anyway related to the edge type of the triplet, right?
In the
train.py
script, copied and pasted below, the first element of the tuple for theadj_list
is the index of thetrain_triplets
,Later on in the
sample_edge_neighborhood
method, you have the follow code to sample the edge,The
chosen_adj_list
is an array of shape num_neighbors x 2, the second dimension being the tuple you're appending in the previous code block. But here,chosen_edge[0]
would give you the index of the training triplet, which is not in anyway related to the edge type of the triplet, right?