Skip to content

Commit

Permalink
change np.Inf to np.inf for numpy>2.0 (#1863)
Browse files Browse the repository at this point in the history
  • Loading branch information
enigne authored Oct 26, 2024
1 parent ba8e824 commit 04bbe7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deepxde/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def __init__(
self.monitor = monitor
self.monitor_op = np.less
self.epochs_since_last_save = 0
self.best = np.Inf
self.best = np.inf

def on_epoch_end(self):
self.epochs_since_last_save += 1
Expand Down Expand Up @@ -221,7 +221,7 @@ def on_train_begin(self):
if self.baseline is not None:
self.best = self.baseline
else:
self.best = np.Inf if self.monitor_op == np.less else -np.Inf
self.best = np.inf if self.monitor_op == np.less else -np.inf

def on_epoch_end(self):
if self.model.train_state.epoch < self.start_from_epoch:
Expand Down

0 comments on commit 04bbe7f

Please sign in to comment.