Skip to content

Commit

Permalink
corrected restoring of saved pars
Browse files Browse the repository at this point in the history
  • Loading branch information
nepslor committed Dec 14, 2023
1 parent d55e6a8 commit f9b9105
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyforecaster/forecasting_models/neural_forecasters.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,10 @@ def fit(self, inputs, targets, n_epochs=None, savepath_tr_plots=None, stats_step
k += 1
if finished:
break
if len(val_loss)>1:
if val_loss[-1] > val_loss[-2]:
pars = old_pars
self.pars = pars
if len(val_loss)>2:
if val_loss[-1] > val_loss[-2]:
pars = old_pars
self.pars = pars
super().fit(inputs_val_0, targets_val_0)
return self

Expand Down

0 comments on commit f9b9105

Please sign in to comment.