best_val_loss is initialized to 1.0 and once the validation loss drops below 1.0, any further decrease will not be taken into account due to the use of max. I am not sure about the logic here but perhaps best_val_loss should be set to None or inf initially and min should be used instead of max.
The code seems to be doing the wrong thing:
best_val_loss
is initialized to 1.0 and once the validation loss drops below 1.0, any further decrease will not be taken into account due to the use ofmax
. I am not sure about the logic here but perhapsbest_val_loss
should be set toNone
orinf
initially andmin
should be used instead ofmax
.