Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"# 损失函数采用最小二乘法,y_pred - y 是形如[47, 1]的向量。\n",
"# tf.matmul(a,b,transpose_a=True) 表示:矩阵a的转置乘矩阵b,即 [1,47] X [47,1]\n",
"# 损失函数操作 loss\n",
"loss_op = 1 / (2 * len(X_data)) * tf.matmul((y_pred - y), (y_pred - y), transpose_a=True)\n",
"loss_op = 1.0 / (2 * len(X_data)) * tf.matmul((y_pred - y), (y_pred - y), transpose_a=True)\n",
"# 随机梯度下降优化器 opt\n",
"opt = tf.train.GradientDescentOptimizer(learning_rate=alpha)\n",
"# 单轮训练操作 train_op\n",
Expand Down