Skip to content

Commit

Permalink
感谢,已修正 | Merge pull request #689 from HaoshuaiXu/patch-1
Browse files Browse the repository at this point in the history
Update optimization_tutorial.md
  • Loading branch information
jiangzhonglian authored Dec 5, 2024
2 parents 5e5e28a + beb52aa commit c1725a2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ epochs = 5

常见的损失函数包括给回归任务用的 `nn.MSELoss`(Mean Square Error, 均方误差)、给分类任务使用的 `nn.NLLLoss`(Negative Log Likelihood, 负对数似然)、`nn.CrossEntropyLoss`(交叉熵损失函数)结合了 `nn.LogSoftmax``nn.NLLLoss`.

我们把模型输出的 logits 传递给 `nn.CrossEntropyLoss`它会正则化 logits 并计算预测误差。
我们把模型输出的 logits 传递给 `nn.CrossEntropyLoss`它会归一化 logits 并计算预测误差。

```py
# 初始化损失函数
Expand Down

0 comments on commit c1725a2

Please sign in to comment.