PyTorch入门学习:2-Linear Model

1 示例

1.1 Training Set & Test Set(泛化能力)

alt text 数据集划分为训练集和测试集,而为了测试集的表现较好,又将训练集划分为训练集和验证集。

1.2 Model design

示例中的数据明显适用线性模型,即 。 Training Loss 定义为模型在训练集上的损失函数值,即

alt text alt text 随着训练轮数的增加,Training Loss 会逐渐减小,但 Validation Loss 会先减小后增大,这是因为模型在训练集上的损失函数值会减小,但是在验证集上的损失函数值会先减小后增大,这说明模型在验证集上的表现开始变差。

在深度学习中经常使用可视化工具来展示模型的训练过程和性能。

1.3 Exercise

  • Try to use the model in right-sight, and draw the cost graph.
© 2026 Boris's Blog All Rights Reserved.
Theme by hiero