文章分类 -  Pytorch学习

摘要:1、AutoEncoder Why needed Unsupervised Learning?(如何利用好这些无监督数据,从重建自己的过程中,发现数据的模态) AutoEncoder: How to Train? PCA VS Auto-Encoders: 2、AutoEncoder 变体 2.1、 阅读全文
posted @ 2020-08-03 21:06 小吴的日常 阅读(217) 评论(0) 推荐(0)
摘要:1、自定义数据集 1 """ 2 自定义数据集的基础操作 3 """ 4 import torch 5 from torch.utils.data import Dataset 6 7 class Pokemon(Dataset): # 继承Datastet类,如自定义模型继承Module类一样 8 阅读全文
posted @ 2020-08-03 09:20 小吴的日常 阅读(310) 评论(0) 推荐(0)
摘要:pytorch处理的都是数据类型,不支持string类型的处理;对于string类型需要转换为其他类型处理,这种表示称为representation or word embeding; Sequence representation: 例如: one-hot编码:稀疏,占了大量的空间,高维 sema 阅读全文
posted @ 2020-07-31 19:55 小吴的日常 阅读(192) 评论(0) 推荐(0)
摘要:1. embed current layers(能调用一些已经写好的函数) 2. Container(会从上到下执行一个forward操作) 3. parameters 4. modules 5. to(device) 6. save and load 7. train/test 8. implem 阅读全文
posted @ 2020-07-29 20:03 小吴的日常 阅读(131) 评论(0) 推荐(0)
摘要:1、什么是卷积 感受野(局部相关性,一次感受一个视野(一个小方块)): 参数变小(参数总数:每个小方块的参数总数,权值共享): 卷积操作:(小方块)相乘再相累加的操作 2、卷积神经网络 3、池化层(降维) Max pooling: 同样还有Avg pooling等 4、inplace=True in 阅读全文
posted @ 2020-07-29 10:41 小吴的日常 阅读(127) 评论(0) 推荐(0)
摘要:1、过拟合与欠拟合 2、如何检测过拟合(Train-Val-Test-交叉验证) 这里的test(validation)用于挑选模型的参数,提前终止train,防止过拟合。 validation set是用来挑选模型参数的。test set是客户在验收的时候,使用的数据集。 把数据集分为train 阅读全文
posted @ 2020-07-28 17:42 小吴的日常 阅读(436) 评论(0) 推荐(0)
摘要:1、梯度 导数:因变量随着自变量的变化而变化的趋势(即函数的变化量)。导数的范围比较广,可以说x的方向,也可以说y的方向。 偏微分:只指变量的方向。偏微分和导数一样,只不过偏微分指定了方向(变量的方向,即有多少个变量就有多少个偏微分) 梯度:所有偏微分的一个向量(dx,dy,......,dz) 凸 阅读全文
posted @ 2020-07-27 09:10 小吴的日常 阅读(154) 评论(0) 推荐(0)
摘要:1、统计属性 1 # 1、norm:范数 2 a = torch.full([8], 1) 3 b = a.view(2, 4) 4 c = a.view(2, 2, 2) 5 print(a.norm(1), b.norm(1), c.norm(1)) # 1范数 tensor(8.) tenso 阅读全文
posted @ 2020-07-24 10:26 小吴的日常 阅读(90) 评论(0) 推荐(0)
摘要:1、基本数据类型 Data type: Type check: a = torch.randn(2, 3) print(a.type()) # torch.FloatTensor print(type(a)) # <class 'torch.Tensor'> print(isinstance(a, 阅读全文
posted @ 2020-07-23 10:33 小吴的日常 阅读(280) 评论(0) 推荐(0)
摘要:1、Pytorch 和 Tensorflow的区别 pytorch是动态图;tensorflow1是静态图;tensorflow2即有动态图模式也有静态图模式: #1、pytorch动态图 w_h = torch.randn(20, 20, requires_grad=True) #2、tensor 阅读全文
posted @ 2020-07-22 20:01 小吴的日常 阅读(136) 评论(0) 推荐(0)