From ffcfebcca8d220ddb5fc1a16a8cfa672f78927c1 Mon Sep 17 00:00:00 2001 From: Dengddd <3149942468@qq.com> Date: Sun, 10 Nov 2024 14:51:22 +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 ab231b1..828e88f 100644 --- a/function.py +++ b/function.py @@ -32,7 +32,7 @@ def sigmoid(z): """Sigmoid 激活函数。""" return 1.0 / (1 + np.exp(-z)) -def train_logreg(X, y, learning_rate=0.001, iterations=1500, batch_size=64, reg_lambda=0.01): +def train_logreg(X, y, learning_rate=0.01, iterations=1500, batch_size=64, reg_lambda=0.01): """训练逻辑回归模型的函数,使用梯度下降算法。""" m, n = X.shape weights = np.random.randn(n) * 0.01 # 初始化权重