From e817959ca516e04bc49da8a6467506c301aa53e5 Mon Sep 17 00:00:00 2001 From: wzy <675163717@qq.com> Date: Sat, 26 Oct 2024 18:20:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20function.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/function.py b/function.py index 4388d14..8745732 100644 --- a/function.py +++ b/function.py @@ -30,7 +30,7 @@ name = "万子玉" def sigmoid(z): return 1 / (1 + np.exp(-z)) -def train_logreg(X, y, learning_rate=0.001, iterations=1000, batch_size=32, initial_weights=None): +def train_logreg(X, y, learning_rate=0.001, iterations=500, batch_size=16, initial_weights=np.zeros(n_features + 1)): X = np.insert(X, 0, 1, axis=1) # 添加偏置项 if initial_weights is None: weights = np.zeros(X.shape[1])