Whatasmallship / comments

0 stars 0 forks source link

PyTorch:优化器 | 干点啥好呢 #21

Open Whatasmallship opened 3 months ago

Whatasmallship commented 3 months ago

https://whatasmallship.github.io/2024/08/22/PyTorch-%E4%BC%98%E5%8C%96%E5%99%A8/#post-comment

随机梯度下降SGD 每次更新的时候使用一个样本进行梯度下降,所谓的随机二字,就是说我们可以随机用一个样本来表示所有的样本,来调整超参数。 12import torch.optim as optimoptimizer = optim.SGD(model.parameters(), lr = 0.01, momentum=0.9) momentum 如图所示,红色为SGD+Momentum。黑色

Whatasmallship commented 3 months ago

Test