twitter-research / graph-neural-pde

Graph Neural PDEs
Apache License 2.0
317 stars 52 forks source link

What criteria are used for early stop solver? #25

Closed Jeong27 closed 9 months ago

Jeong27 commented 11 months ago

I am curious about the conditions under which the classes defined in the 'early_stop_solver.py' file perform 'early stopping'.

Initially, I thought that the final integration is performed at the time step that shows the best validation accuracy calculated by the evaluate function in the 79th line (inside the advance function of the EarlyStopDopri5 class) and the 175th line (inside the integrate function of the EarlyStopRK4 class). However, I couldn't find where these calculated validation accuracies are utilized.

If early stopping is indeed based on validation accuracy, as I understood, I am curious about where this is implemented. If not, I would like to know what criteria are used for early stopping.

melifluos commented 9 months ago

@Jeong27 I'm doing my best to remember, but it was three years ago. If I recall correctly (which I may not) you're correct, the early stop solver decouples the integration time used at training and inference so that the best inference optimisation time is used. Essentially we choose the test corresponding the the time with the highest validation score at inference time and this is handled in L80-80 if val_acc > self.best_val: self.set_accs(train_acc, val_acc, test_acc, self.rk_state.t1)

Jeong27 commented 9 months ago

Thank you for your response!

After your clarification and further investigation, I realized that the "early stop" doesn't occur in the early_stop_solver. Instead, the code utilizing the saved val_acc is found in the main function of the GNN_early.py file (lines 163-169).

I had some confusion as I couldn't locate where the saved val_acc is utilized in the early_stop_solver.py file or run_GNN.py file.

I appreciate your clarification, and thank you once again for your assistance.

Best regards, MoonJeong