From de38186cef654e2440f151f52d906430838350c2 Mon Sep 17 00:00:00 2001 From: guanjihuan Date: Tue, 4 Jun 2024 17:58:53 +0800 Subject: [PATCH] Update early_stop.py --- 2024.06.04_early_stop/early_stop.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2024.06.04_early_stop/early_stop.py b/2024.06.04_early_stop/early_stop.py index d8fa2aa..5cd03c5 100644 --- a/2024.06.04_early_stop/early_stop.py +++ b/2024.06.04_early_stop/early_stop.py @@ -3,7 +3,7 @@ This code is supported by the website: https://www.guanjihuan.com The newest version of this code is on the web page: https://www.guanjihuan.com/archives/41201 """ -def get_break_signal_from_loss_array(loss_array, patience=10, min_delta=0.001): +def get_break_signal_from_loss_array(loss_array, patience=100, min_delta=0.001): break_signal = 0 counter = 0 num = len(loss_array) @@ -16,7 +16,7 @@ def get_break_signal_from_loss_array(loss_array, patience=10, min_delta=0.001): print(counter) # 查看满足条件的次数 return break_signal -train_times = 100 +train_times = 50 for i0 in range(train_times): print('Training...') loss_array = [10, 3, 1, 0.1, 0.02, 0.003, 0.001, 0.0004, 0.0005, 0.0001, 0.0003]