Open
Description
def encode_onehot(labels):
classes = set(labels)
classes_dict = {c: np.identity(len(classes))[i, :] for i, c in
enumerate(classes)}
labels_onehot = np.array(list(map(classes_dict.get, labels)),
dtype=np.int32)
return labels_onehot
off_diag = np.ones([self.num_nodes, self.num_nodes])
rel_rec = np.array(encode_onehot(np.where(off_diag)[0]), dtype=np.float32) #?
rel_send = np.array(encode_onehot(np.where(off_diag)[1]), dtype=np.float32) #?
self.rel_rec = torch.FloatTensor(rel_rec).to(device)
self.rel_send = torch.FloatTensor(rel_send).to(device)
hi!I have some questions with the above code,so rel_rec 、rel_send `s mean is what?
Thank you for your reply!
Metadata
Metadata
Assignees
Labels
No labels