A sigmoid activation converts a real-valued score into a probability between zero and one. In binary prediction, this makes a model’s output interpretable as the likelihood of a class or link. section 9.3.1 section 12.2.4
A practical sigmoid-based prediction pipeline follows these steps:
- Generate feature vectors or embeddings for the entities being classified, such as graph nodes or users and movies. section 9.3.1 section 12.2.4
- Compute a score from the representations. Logistic regression uses a linear combination of features, while link prediction uses a user–movie dot product. section 9.3.1 section 12.2.4
- Apply sigmoid to convert the score into a probability, then compare that probability with the binary interaction label during optimization. section 12.2.4
Movie recommendation link prediction
A heterogeneous GNN produces user and movie embeddings. A dot product scores each potential user–movie interaction; sigmoid converts the score into the probability that the link exists. PyTorch’s F.binary_cross_entropy_with_logits combines the sigmoid operation with binary cross-entropy loss for training. section 12.2.4
Figure 12.9 Pipeline for processing heterogeneous graph data in a link prediction system for movie recommendations. The data consists of users and movies as node types and user–movie ratings as edges. Embeddings are generated, with user embeddings learned by the model and movie embeddings initialized from genre features. The data is processed using three heterogeneous GNN encoders (H-GraphConv, H-GAT, and H-SAGE), which aggregate neighbor features to generate node representations. A dot product then quantifies the compatibility between users and movies, with higher scores indicating a greater likelihood of interaction. The scores are finally converted into probabilities representing the likelihood of a link between users and movies.
Follow the complete heterogeneous-graph pipeline from node embeddings and GNN encoders through dot-product compatibility scores and final link probabilities. section 12.2.4















