Accenture / AmpliGraph

Python library for Representation Learning on Knowledge Graphs https://docs.ampligraph.org
Apache License 2.0
2.14k stars 251 forks source link

Reimplement multiclass loss to make it more stable numerically #170

Closed sumitpai closed 4 years ago

sumitpai commented 4 years ago

Description

Multiclass_loss = log (exp(score_pos)/sum(exp(score_pos) + exp(score_neg)))

when score_pos goes above certain value, the loss becomes inf/inf which results in NaN loss. Currently we can use high regularization to avoid this. However it sometimes does occur