paper preperations and notebooks, optuna callbacks

This commit is contained in:
Steffen Illium
2021-04-02 08:45:11 +02:00
parent abe870d106
commit faa27c3cf9
5 changed files with 26 additions and 15 deletions

View File

@ -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: