Pytorch, Machine Learning, Gradient Descent, Python, Hands On Tutorials.
wi / 100.0 b = -5.0 + 13.0 * wb / 100.0 ywb = x * w + b losses[wi][wb] = loss_fn(ywb, y).item() return list(reversed(losses)) # Because y will be reversed. import pylab loss_fn = torch.nn.MSELoss() losses = get_loss_map(loss_fn, x, y) cm = pylab.get_cmap('terrain') fig, ax = plt.subplots()