![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
深度学习
chunbaise92
这个作者很懒,什么都没留下…
展开
-
Pytorch入门之线性回归
import numpy as npimport matplotlib.pyplot as pltimport torchimport torch.nn as nnfrom torch.autograd import Variablex_train=np.array([[3.3],[4.4],[5.5],[6.71],[6.93],[4.168], ...原创 2018-11-01 17:47:51 · 155 阅读 · 0 评论 -
regression(2)
import torchimport torch.nn.functional as F # 激励函数都在这import matplotlib.pyplot as pltfrom torch.autograd import Variablex = torch.unsqueeze(torch.linspace(-1, 1, 100), dim=1) # x data (tenso...转载 2018-11-02 18:27:36 · 213 阅读 · 0 评论 -
莫烦Pytorch系列之分类代码
import torch#from torch.autograd import Variableimport torch.nn.functional as Fimport matplotlib.pyplot as pltn_data=torch.ones(100,2) # 数据的基本形态x0=torch.normal(2*n_data,1) # 类型0 x data (te...原创 2018-11-04 18:35:55 · 648 阅读 · 0 评论 -
莫烦Pytorch之快速构建网络代码
import torchimport torch.nn.functional as Fclass Net(torch.nn.Module): def __init__(self,n_feature,n_hidden,n_output): super(Net,self).__init__() self.hidden=torch.nn.Linear(n_f...原创 2018-11-04 18:43:27 · 123 阅读 · 0 评论 -
莫烦Pytorch之保存加载网络
import torchfrom torch.autograd import Variableimport matplotlib.pyplot as pltx=torch.unsqueeze(torch.linspace(-1,1,1000),dim=1)y=x.pow(2)+0.2*torch.rand(x.size())def save(): net1=torch.nn....原创 2018-11-05 17:22:26 · 205 阅读 · 0 评论