YuhanZhen / WSDM23-DGNNs--for-Session-based-Recommendation

16 stars 2 forks source link

The model has a loss explosion #5

Open Opium1715 opened 6 months ago

Opium1715 commented 6 months ago

At first, I wanted to reproduce the model in one side of the paper and find that there was a sudden change in the loss value of the model, and I considered that there might be a problem with the code I wrote, but as I trained to shuffle the data using the code you provided, I found that the models performed even worse than the baseline models. I want to know the reason for it. Here is the log for diginetica: `Namespace(batchSize=100, dataset='diginetica', dropout_global_att=0.5, dropout_global_ffn=0.5, epoch=50, fuse_A=False, global_att_block_nums=5, global_att_head_nums=4, hiddenSize=100, l2=1e-05, len_max=70, log_file='log/', lr=0.001, lr_dc=0.5, lr_dc_step=3, mt=0.9, nonhybrid=False, patience=5, random_seed=2023, step_global=2, valid_portion=0.1, validation=False)

epoch: 0 start training: 2024-01-01 11:52:45.308890 [0/7195] Loss: 27.5485 [1440/7195] Loss: 10.9777 [2880/7195] Loss: 9.7999 [4320/7195] Loss: 9.6156 [5760/7195] Loss: 9.9798 Loss: 11116660.000 start predicting: 2024-01-01 12:09:25.491104 Best Result: Recall@20: 2.4023 MRR@20: 0.5991 Epoch: 0, 0

epoch: 1 start training: 2024-01-01 12:10:01.090347 [0/7195] Loss: 9.9828 [1440/7195] Loss: 9.6239 [2880/7195] Loss: 9.4968 [4320/7195] Loss: 9.1807 [5760/7195] Loss: 9.1118 Loss: 66645.367 start predicting: 2024-01-01 12:26:09.564610 Best Result: Recall@20: 15.6183 MRR@20: 6.6248 Epoch: 1, 1

epoch: 2 start training: 2024-01-01 12:26:45.536726 [0/7195] Loss: 8.2637 [1440/7195] Loss: 7.5912 [2880/7195] Loss: 7.6452 [4320/7195] Loss: 7.4787 [5760/7195] Loss: 6.0168 Loss: 51509.770 start predicting: 2024-01-01 12:42:20.687064 Best Result: Recall@20: 40.8804 MRR@20: 13.7498 Epoch: 2, 2

epoch: 3 start training: 2024-01-01 12:42:56.356750 [0/7195] Loss: 5.3405 [1440/7195] Loss: 5.6619 [2880/7195] Loss: 5.6990 [4320/7195] Loss: 5.7722 [5760/7195] Loss: 5.4789 Loss: 39532.090 start predicting: 2024-01-01 12:58:38.929466 Best Result: Recall@20: 46.1928 MRR@20: 14.8526 Epoch: 3, 3

epoch: 4 start training: 2024-01-01 12:59:14.158401 [0/7195] Loss: 4.8617 [1440/7195] Loss: 4.8962 [2880/7195] Loss: 5.1665 [4320/7195] Loss: 4.4588 [5760/7195] Loss: 5.1889 Loss: 36795.996 start predicting: 2024-01-01 13:15:26.259299 Best Result: Recall@20: 47.4021 MRR@20: 15.4193 Epoch: 4, 4

epoch: 5 start training: 2024-01-01 13:16:03.688753 [0/7195] Loss: 4.3405 [1440/7195] Loss: 3.7692 [2880/7195] Loss: 4.1741 [4320/7195] Loss: 4.6730 [5760/7195] Loss: 4.6486 Loss: 32908.430 start predicting: 2024-01-01 13:32:18.182128 Best Result: Recall@20: 49.0585 MRR@20: 16.2033 Epoch: 5, 5

epoch: 6 start training: 2024-01-01 13:32:54.680015 [0/7195] Loss: 4.4499 [1440/7195] Loss: 4.6243 [2880/7195] Loss: 4.9378 [4320/7195] Loss: 4.4453 [5760/7195] Loss: 4.0763 Loss: 31747.654 start predicting: 2024-01-01 13:48:37.885409 Best Result: Recall@20: 49.0585 MRR@20: 16.2033 Epoch: 5, 5

epoch: 7 start training: 2024-01-01 13:49:13.562323 [0/7195] Loss: 3.8805 [1440/7195] Loss: 4.3621 [2880/7195] Loss: 4.1479 [4320/7195] Loss: 4.8036 [5760/7195] Loss: 4.4075 Loss: 30829.979 start predicting: 2024-01-01 14:05:17.513654 Best Result: Recall@20: 49.0585 MRR@20: 16.2033 Epoch: 5, 5

epoch: 8 start training: 2024-01-01 14:05:55.948187 [0/7195] Loss: 4.0207 [1440/7195] Loss: 3.7049 [2880/7195] Loss: 3.6689 [4320/7195] Loss: 3.6551 [5760/7195] Loss: 4.1188 Loss: 27981.684 start predicting: 2024-01-01 14:21:51.314921 Best Result: Recall@20: 49.0585 MRR@20: 16.2033 Epoch: 5, 5

epoch: 9 start training: 2024-01-01 14:22:32.833635 [0/7195] Loss: 3.8111 [1440/7195] Loss: 3.4000 [2880/7195] Loss: 3.7666 [4320/7195] Loss: 4.5096 [5760/7195] Loss: 3.9265 Loss: 27159.809 start predicting: 2024-01-01 14:38:48.125989 Best Result: Recall@20: 49.0585 MRR@20: 16.2033 Epoch: 5, 5

epoch: 10 start training: 2024-01-01 14:39:23.783912 [0/7195] Loss: 3.5182 [1440/7195] Loss: 3.6514 [2880/7195] Loss: 3.4650 [4320/7195] Loss: 3.2148 [5760/7195] Loss: 4.0791 Loss: 26585.742 start predicting: 2024-01-01 14:55:43.640522 Best Result: Recall@20: 49.0585 MRR@20: 16.2033 Epoch: 5, 5

Run time: 11015.887511 s ---------------Test------------------------ 49.03217325577574 16.21360703419232 `