binary_cross_entropy_with_logits causes loss stuck at 0.6931 on large graphs, solved by using cosine similarity #10292
lmh1020lmh
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I encountered a problem when training a large-scale link prediction model using GraphSAGE in PyTorch Geometric. When using dot-product with binary_cross_entropy_with_logits, the training loss quickly plateaus at ~0.6931 and fails to decrease any further, especially on large graphs with many nodes and edges.
problem code link
Here is the problematic code:
However, after switching to cosine similarity + binary_cross_entropy (after mapping to [0,1]), the loss starts to decrease and the model trains normally:
This change significantly improved convergence
Beta Was this translation helpful? Give feedback.
All reactions