Pytorch, Torch, Torchvision, Deep Learning, Python.
print(w.grad.data[0]) w.data = w.data - 0.01 * w.grad.data[0] w.grad.data.zero_() print("epoch:", epoch, "loss value:", loss.data[0]) print("-------") >> tensor(-72.) tensor(165.3600) tensor(-449.9712) epoch: 0 loss value: tensor(258.2578) ------- tensor(955.0402) tensor(-2100.6899)