Accenture / AmpliGraph

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

Early stopping with numeric edge values #253

Open AlejandroTL opened 3 years ago

AlejandroTL commented 3 years ago

Hello!

Is there any way to specify in the early stopping parameters the numeric edge values of the validation test? I'm trying to do it but I cannot find where to place the numeric edge values of my validation set. If not, what should be the path to implement early stopping with numeric values on the edges? Manually?

Thank you, awesome library!

sumitpai commented 3 years ago

During the test/valid time, we don't specify the numeric values. Instead, what we would expect is that when a triple has a high numeric value, when ranked against all corruptions, the triple should get a good rank; while a triple with a low numeric value MIGHT probably be noise, and you can expect it to be ranked lower. This needs to be done manually.

For validation in specific, we can train the model to early stop if it does good on high valued triples (i.e. you can pass only high valued triples to early stopping paramter x_valid and early stop on mrr criteria)

sumitpai commented 3 years ago

The numeric values are mainly used during training to focus the models on high valued triples over the low valued ones. At test time one can split the test set into 2 parts (as done in paper) and see if models performs good on these 2 sets using the delta mrr metric