abojchevski/graph2gauss

Bug with early stopping on loss

dfdazac opened this issue · 1 comments

Thanks for open sourcing your code!
This line:

early_stopping_score_max = -1.0

is problematic for some datasets when training with p_val = 0 and p_test = 0 (as in the case of node classification), because the loss might start at values much higher than 1 and it might take more than 100 epochs to reach this value. This means that self.__save_vars() is never called, so then an exception is raised here:

self.__restore_vars(sess)

because the attribute self.saved_vars does not exist. I worked around this by changing the first line above to

early_stopping_score_max = -float('inf')

Thanks for catching this! I've added the proposed change to the code.