paper preperations and notebooks, optuna callbacks
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import torch
|
||||
from pytorch_lightning import Callback, Trainer, LightningModule
|
||||
|
||||
|
||||
@ -17,6 +18,10 @@ class BestScoresCallback(Callback):
|
||||
current_score = trainer.callback_metrics.get(monitor)
|
||||
if current_score is None:
|
||||
pass
|
||||
elif torch.isinf(current_score):
|
||||
pass
|
||||
elif torch.isnan(current_score):
|
||||
pass
|
||||
else:
|
||||
self.best_scores[monitor] = max(self.best_scores[monitor], current_score)
|
||||
if self.best_scores[monitor] == current_score:
|
||||
|
Reference in New Issue
Block a user