![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytorch学习笔记
一只小白dog
这个作者很懒,什么都没留下…
展开
-
pytorch学习笔记(四)
1. 数据集的加载与处理在此处下载数据集,是一个面部姿态处理的数据集。由如下几个部分构成:其中图片为原图,face_landmarks.csv文件中记录了每张图片和其对应的关键点的坐标信息 。现在先加载一副图片以及其对应的坐标信息看一下人脸关键点显示的效果:# 加载表格landmarks_frame = pd.read_csv('data/faces/face_landmarks.cs...原创 2019-07-13 09:44:04 · 296 阅读 · 0 评论 -
pytorch学习笔记(一)
一、索引与切片1.index_select:给定如下一个a:a = np.arange(2*2*2*2)a = torch.from_numpy(a)a = torch.reshape(a, [2,2,2,2])aout: tensor([[[[ 0, 1], [ 2, 3]], [[ 4, 5], ...原创 2019-07-11 11:54:55 · 507 阅读 · 0 评论 -
pytorch学习笔记(二)
import torchimport numpy as np一、合并与切割1.concata1 = torch.rand(4, 3, 32, 32)a2 = torch.rand(5, 3, 32, 32)# 将a1与a2的第0个维度相加torch.cat([a1, a2], dim=0).shapeout:torch.Size([9, 3, 32, 32])a2 = t...原创 2019-07-11 16:32:39 · 154 阅读 · 0 评论 -
pytorch学习笔记(三)
首先定义一个网络:# 定义一个网络class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.conv1 = nn.Conv2d(1, 6, 5) self.conv2 = nn.Conv2d(6, 16, 5) self.fc1 ...原创 2019-07-12 15:04:27 · 229 阅读 · 0 评论