各种优化器的比较 莫烦的对各种优化通俗理解的视频 import torch import torch.utils.data as Data import torch.nn.functional as F from torch.autograd import Variable import matplotlib.pyplot as plt # 超参数 LR = 0.01 BATCH_SIZE = EPOCH = # 生成假数据 # torch.unsqueeze() 的作用是将一维变二维,torc…
import torch from torch.autograd import Variable import matplotlib.pyplot as plt torch.manual_seed() # fake data x = torch.unsqueeze(torch.linspace(-,,),dim=) y = x.pow() + 0.2 * torch.rand(x.size()) x, y = Variable(x,requires_grad=False), Variable(y…