![](https://img-blog.csdnimg.cn/20190413200956337.jpeg?x-oss-process=image/resize,m_fixed,h_224,w_224)
Pytorch 学习笔记
文章平均质量分 88
Pytorch 学习笔记
轮子去哪儿了
研究生在读:https://github.com/yangzhaonan18
展开
-
PyTorch 中的 dropout Dropout2d Dropout3d
文章目录PyTorch 中的 dropout1. [Pytoch 说明文档官网 PyTorch documentation 链接](https://pytorch.org/docs/stable/index.html)1.1. `torch.nn` 中的 `dropout`1.1. `torch.nn` 和 `torch.nn.functional` 中的 `dropout` 功能相同。2. [知乎:PyTorch 中,nn 与 nn.functional 有什么区别?](https://www.zhi原创 2021-04-27 22:53:12 · 9488 阅读 · 0 评论 -
Pytorch 查询笔记 持续更新
文章目录1. pytorch中 max()、view()、 squeeze()、 unsqueeze() 的区别2. torchvision.transforms.ToPILImage / ToTensor 通道的变化1. pytorch中 max()、view()、 squeeze()、 unsqueeze() 的区别链接查询时间:2019年3月15日10:17:46max() 求行或...原创 2019-03-18 12:28:05 · 250 阅读 · 0 评论 -
pytorch 8 CNN 卷积神经网络
pytorch 8 CNN 卷积神经网络# library# standard libraryimport os# third-party libraryimport torchimport torch.nn as nnimport torch.utils.data as Dataimport torchvisionimport matplotlib.pyplot as p...原创 2019-02-26 21:47:00 · 300 阅读 · 0 评论 -
pytorch 7 save_reload 保存和提取神经网络
pytorch 7 save_reload 保存和提取神经网络import torchimport matplotlib.pyplot as plt# torch.manual_seed(1) # reproducible# fake datax = torch.unsqueeze(torch.linspace(-1, 1, 100), dim=1) # x data (...原创 2019-02-26 20:02:00 · 204 阅读 · 0 评论 -
pytorch 6 build_nn_quickly 快速搭建神经网络
pytorch 6 build_nn_quickly 快速搭建神经网络import torchimport torch.nn.functional as F# replace following class code with an easy sequential networkclass Net(torch.nn.Module): def __init__(self, n...原创 2019-02-26 19:38:00 · 142 阅读 · 0 评论 -
pytorch 5 classification 分类
pytorch 5 classification 分类import torchfrom torch.autograd import Variableimport torch.nn.functional as Fimport matplotlib.pyplot as pltn_data = torch.ones(100, 2) # 100个具有2个属性的数据 shape=(100,...原创 2019-02-26 19:28:00 · 339 阅读 · 0 评论 -
pytorch 4 regression 回归
pytorch 4 regression 回归import torchimport torch.nn.functional as Fimport matplotlib.pyplot as plt# torch.manual_seed(1) # reproduciblex = torch.unsqueeze(torch.linspace(-1, 1, 100), dim=1)...原创 2019-02-26 19:24:00 · 192 阅读 · 0 评论 -
pytorch 3 activation 激活函数
pytorch 3 activation 激活函数2.3 Activation Functionimport torchimport torch.nn.functional as Ffrom torch.autograd import Variableimport matplotlib.pyplot as plt# fake datax = torch.linspace(-...原创 2019-02-26 19:21:00 · 482 阅读 · 0 评论 -
pytorch 2 variable 变量
pytorch 2 variable 变量import torchfrom torch.autograd import Variabletensor = torch.FloatTensor([[1, 2], [3, 4]])variable = Variable(tensor, requires_grad=True)print(tensor) # tensor([[1., 2...原创 2019-02-26 19:20:00 · 215 阅读 · 0 评论 -
pytorch 1 torch_numpy, 对比
pytorch 1 torch_numpy, 对比import torchimport numpy as npdetails about math operation in torch can be found in: http://pytorch.org/docs/torch.html#math-operationsconvert numpy to tensor or vise ...原创 2019-02-26 19:20:00 · 445 阅读 · 0 评论 -
【异常】TypeError: can't convert np.ndarray of type numpy.object_. The only supported types are: double,
1. 问题:TypeError: can’t convert np.ndarray of type numpy.object_. The only supported types are: double, float, float16, int64, int32, and uint8.2. 异常代码行:train_x = torch.from_numpy(train_x).float().u...原创 2019-08-27 11:43:45 · 34264 阅读 · 0 评论