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 # 初始化权重