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

loss of GAAN is nan #101

Closed AnonymousDataCodeHub closed 8 months ago

AnonymousDataCodeHub commented 8 months ago

image

image

I believe it is caused by a_[edge_index[0], edge_index[1]]. However, the shape of edge_index is [2,0] due to the usage of NeighborLoader with num_neigh= 0 in base.py, even when the batch size is either 0 or any other number.

image

Therefore, a_[edge_index[0], edge_index[1]] should be changed to a_.

kayzliu commented 8 months ago

Thanks for pointing it out. As per Eq. 5 in the original paper, the first $A_{ij}$ represents that only the positive edges should be counted in the loss function. I have fixed the error in num_neigh. It should work now. If you have any further questions, feel free to let us know :)