PetarV- / GAT

Graph Attention Networks (https://arxiv.org/abs/1710.10903)
https://petar-v.com/GAT/
MIT License
3.15k stars 643 forks source link

output the uodated label #59

Closed tanjia123456 closed 3 years ago

tanjia123456 commented 3 years ago

Hello, I recently wanted to output the updated labels, so I added a pred_tr in the training phase:

_, loss_value_tr, acc_tr,pred_tr = sess.run([train_op, loss, accuracy,log_resh]

Then, I found that pred_tr is indeed (2708, 7) but the value inside is positive or negative. I used the following code to output the updated label with open("./embeddings_target.txt", "w") as fe, open("./labels_target.txt", 'w') as fl: for i in range(len(pred_tr)): fl.write(label_dict[int(list(pred_tr[i]).index(1.))]+ "\n") fe.write(" ".join(map(str, pred_tr[i])) + "\n") the error occurs: ValueError: 1.0 is not in list

I just want to ask, the probability of each node for the 7 categories has positive and negative numbers. What should I do?