tkipf / keras-gcn

Keras implementation of Graph Convolutional Networks
MIT License
791 stars 266 forks source link

Low accuracy about Cora dataset #62

Closed wubo2180 closed 4 years ago

wubo2180 commented 4 years ago

I have trouble when Cora dataset is training. The accuracy of training data or validation data is low. The final test set is also low. Here is the progress of training. Epoch: 0001 train_loss= 1.9348 train_acc= 0.3000 val_loss= 1.9350 val_acc= 0.3433 time= 0.5864 Epoch: 0002 train_loss= 1.9233 train_acc= 0.2929 val_loss= 1.9232 val_acc= 0.3500 time= 0.0636 Epoch: 0003 train_loss= 1.9115 train_acc= 0.2929 val_loss= 1.9111 val_acc= 0.3500 time= 0.0658 Epoch: 0004 train_loss= 1.8995 train_acc= 0.2929 val_loss= 1.8989 val_acc= 0.3500 time= 0.0618 Epoch: 0005 train_loss= 1.8874 train_acc= 0.2929 val_loss= 1.8868 val_acc= 0.3500 time= 0.0618 Epoch: 0006 train_loss= 1.8757 train_acc= 0.2929 val_loss= 1.8751 val_acc= 0.3500 time= 0.0600 Epoch: 0007 train_loss= 1.8644 train_acc= 0.2929 val_loss= 1.8638 val_acc= 0.3500 time= 0.0618 Epoch: 0008 train_loss= 1.8535 train_acc= 0.2929 val_loss= 1.8531 val_acc= 0.3500 time= 0.0597 Epoch: 0009 train_loss= 1.8434 train_acc= 0.2929 val_loss= 1.8431 val_acc= 0.3500 time= 0.0608 Epoch: 0010 train_loss= 1.8341 train_acc= 0.2929 val_loss= 1.8340 val_acc= 0.3500 time= 0.0599 Epoch: 0011 train_loss= 1.8259 train_acc= 0.2929 val_loss= 1.8259 val_acc= 0.3500 time= 0.0616 Epoch: 0012 train_loss= 1.8189 train_acc= 0.2929 val_loss= 1.8191 val_acc= 0.3500 time= 0.0597 Epoch: 0013 train_loss= 1.8133 train_acc= 0.2929 val_loss= 1.8137 val_acc= 0.3500 time= 0.0608 Epoch: 0014 train_loss= 1.8089 train_acc= 0.2929 val_loss= 1.8097 val_acc= 0.3500 time= 0.0602 Epoch: 0015 train_loss= 1.8058 train_acc= 0.2929 val_loss= 1.8070 val_acc= 0.3500 time= 0.0598 Epoch: 0016 train_loss= 1.8038 train_acc= 0.2929 val_loss= 1.8057 val_acc= 0.3500 time= 0.0601 Epoch: 0017 train_loss= 1.8026 train_acc= 0.2929 val_loss= 1.8054 val_acc= 0.3500 time= 0.0587 Epoch: 0018 train_loss= 1.8020 train_acc= 0.2929 val_loss= 1.8060 val_acc= 0.3500 time= 0.0597 Epoch: 0019 train_loss= 1.8018 train_acc= 0.2929 val_loss= 1.8070 val_acc= 0.3500 time= 0.0588 Epoch: 0020 train_loss= 1.8016 train_acc= 0.2929 val_loss= 1.8083 val_acc= 0.3500 time= 0.0598 Epoch: 0021 train_loss= 1.8013 train_acc= 0.2929 val_loss= 1.8094 val_acc= 0.3500 time= 0.0608 Epoch: 0022 train_loss= 1.8009 train_acc= 0.2929 val_loss= 1.8104 val_acc= 0.3500 time= 0.0598 Epoch: 0023 train_loss= 1.8003 train_acc= 0.2929 val_loss= 1.8110 val_acc= 0.3500 time= 0.0598 Epoch: 0024 train_loss= 1.7994 train_acc= 0.2929 val_loss= 1.8113 val_acc= 0.3500 time= 0.0591 Epoch: 0025 train_loss= 1.7984 train_acc= 0.2929 val_loss= 1.8115 val_acc= 0.3500 time= 0.0602 Epoch: 0026 train_loss= 1.7972 train_acc= 0.2929 val_loss= 1.8111 val_acc= 0.3500 time= 0.0598 Epoch: 0027 train_loss= 1.7960 train_acc= 0.2929 val_loss= 1.8106 val_acc= 0.3500 time= 0.0598 Epoch: 0028 train_loss= 1.7948 train_acc= 0.2929 val_loss= 1.8101 val_acc= 0.3500 time= 0.0587 Epoch 28: early stopping Test set results: loss= 1.8895 accuracy= 0.3090

After I check the 'preds', I found that the 3rd position of every predicted label is the max value. So I feel confused about this phenomenon. Here are the results.

preds[0] Out[38]: array([0.27977338, 0.06094464, 0.23509593, 0.07289325, 0.12192024, 0.09461915, 0.13475344], dtype=float32)

preds[1] Out[39]: array([0.23832573, 0.07919615, 0.21053556, 0.08959897, 0.12324397, 0.10658963, 0.15251002], dtype=float32)

preds[2] Out[40]: array([0.24100392, 0.07752313, 0.21036234, 0.08926065, 0.12199645, 0.10610297, 0.15375063], dtype=float32)

preds[3] Out[41]: array([0.26938447, 0.06453336, 0.22921437, 0.0769949 , 0.12135986, 0.09752691, 0.14098613], dtype=float32)

I sincerely hope that my doubts will be answered.Thanks!