pygod-team / pygod

A Python Library for Graph Outlier Detection (Anomaly Detection)
https://pygod.org
BSD 2-Clause "Simplified" License
1.31k stars 127 forks source link

Problem for CoLA and ANEMONE models. #43

Closed 1017027994zjj closed 1 year ago

1017027994zjj commented 2 years ago

The codes for masking the target nodes is wrong. The target node is the first node in subgraph after the RandomWalk sample, while you mask the last node. The performance of CoLa and ANEMONE will improve 2% by fixing the bug.

Wrong codes in CoLA(line 361~364) batch_feature = torch.cat( (batch_feature[:, :-1, :], added_feat_zero_row, batch_feature[:, -1:, :]), dim=1)

Correct codes: batch_feature = torch.cat( (added_feat_zero_row, batch_feature[:, 1:, :], batch_feature[:, 0:1, :]), dim=1)

Wrong codes in ANEMONE(line 288~289 and 429~430) bf = torch.cat( (bf[:, :-1, :], added_feat_zero_row, bf[:, -1:, :]), dim=1)

Correct codes: bf = torch.cat( (added_feat_zero_row, bf[:, 1:, :], bf[:, 0 : 1, :]), dim=1)

kayzliu commented 2 years ago

Thanks a lot for you issue. Could you please help us to create a PR? So that your contribution will be shown in the repo later.

kayzliu commented 1 year ago

CoLA is now refactored.