WeightedLinkPredictAdvBCELossFunc
- class graphstorm.model.WeightedLinkPredictAdvBCELossFunc(adversarial_temperature)
Bases:
LinkPredictAdvBCELossFuncBinary cross entropy loss function for link prediction tasks with adversarial loss for negative samples and weights on positive samples.
The loss function of a positive edge is defined as:
\[loss_{pos} = - w * \log score\]where
scoreis the score value of the positive edges computed by the score function, andwis the weight of each positive edge. The loss of the negative edges is the same as LinkPredictAdvBCELossFunc.The final loss is defined as:
\[loss = \dfrac{\mathrm{avg}(loss_{pos}) + \mathrm{avg}(loss_{neg})}{2}\]