PyTorch学习笔记

tutorials for beginner
http://pytorch.org/tutorials/beginner/deep_learning_60min_blitz.html
http://pytorch.org/docs/master/

Pytorch简易安装
https://blog.csdn.net/red_stone1/article/details/78727096

基础入门
http://www.datakit.cn/blog/2017/03/03/pytorch_01_basic.html
#!/root/anaconda3/bin/python
import os

import torch
from torch.autograd import Variable
w1 = Variable(torch.Tensor([1.0,2.0,3.0]),requires_grad=True)
w2 = Variable(torch.Tensor([1.0,2.0,3.0]),requires_grad=True)

z = 2*w2+w1

print(z)

res = torch.mean(z)
res.backward(torch.FloatTensor([0.5]))
z.backward(torch.FloatTensor([0.5, 1, 1]))
print(w1.grad, w2.grad)


发表于:2017-10-26 16:44:31

原文链接(转载请保留): http://www.multisilicon.com/blog/a24335058.html

友情链接: MICROIC
首页