摘要: import torch.nn as nn from PIL import Image from torchvision import transforms from matplotlib import pyplot as plt import torch import sys import os 阅读全文
posted @ 2020-12-21 19:58 笨喵敲代码 阅读(483) 评论(0) 推荐(0)
摘要: 卷积层 1. 1d/2d/3d卷积 Dimension of Convolution 卷积运算:卷积核在输入信号(图像)上滑动,相应位置上进行乘加 卷积核:又称为滤波器,过滤器,可认为是某种模式,某种特征。 卷积过程类似于用一个模版去图像上寻找与它相似的区域,与卷积核模式越相似,激活值越高,从而实现 阅读全文
posted @ 2020-12-21 10:49 笨喵敲代码 阅读(268) 评论(0) 推荐(0)
摘要: containers graph LR A["Containers"] --> B["nn.Sequetial"] B["nn.Sequetial"] --> C["wrap multiple network layers in sequence"] A["Containers"] --> D["n 阅读全文
posted @ 2020-12-20 22:13 笨喵敲代码 阅读(139) 评论(0) 推荐(0)
摘要: 模型创建与nn.Module 网络模型创建步骤 nn.Module graph LR 模型 --> 模型创建 模型创建 --> 构建网络层 构建网络层 --> id[卷积层,池化层,激活函数层] 模型 --> 权值初始化 权值初始化 --> id1[Xavier,Kaiming,均匀分布,正太分布] 阅读全文
posted @ 2020-12-20 17:13 笨喵敲代码 阅读(331) 评论(0) 推荐(0)
摘要: 图像变换 Pad 对图片边缘进行填充 transforms.Pad(padding,fill=0,padding_mode='constant') padding:设置填充大小,(a,b,c,d)左上右下填充abcd padding_mode:填充模式,4种模式,constant,edge,refl 阅读全文
posted @ 2020-12-18 16:41 笨喵敲代码 阅读(508) 评论(0) 推荐(0)
摘要: transforms transforms运行机制 torchvision.transforms:常用的图像预处理方法 torchvision.datasets:常用数据及的dataset实现,mnist,cifar-10,imagenet等 torchvision.model:常用的模型与训练,A 阅读全文
posted @ 2020-12-18 16:40 笨喵敲代码 阅读(245) 评论(0) 推荐(0)
摘要: import numpy as np import torch import os import random from PIL import Image from torch.utils.data import Dataset from torch.utils.data import DataLo 阅读全文
posted @ 2020-12-17 16:40 笨喵敲代码 阅读(87) 评论(0) 推荐(0)
摘要: DataLoader与Dataset pytorch中的数据读取机制 graph TB DataLoader --> DataLoaderIter DataLoaderIter --> Sampler Sampler --> Index Sampler --> DatasetFetcher Inde 阅读全文
posted @ 2020-12-16 16:35 笨喵敲代码 阅读(276) 评论(0) 推荐(0)
摘要: autograd与逻辑回归 自动求导系统中两个常用的方法: torch.autograd.backward and torch.autograd.grad 演示理解一阶导数、二阶导数的求导过程 理解自动求导系统,以及张量,前向传播构建计算图、计算图求取梯度 演示逻辑回归训练,学习五大模块:数据、模型 阅读全文
posted @ 2020-12-15 20:56 笨喵敲代码 阅读(292) 评论(0) 推荐(0)
摘要: 转载:https://www.cnblogs.com/marsggbo/p/11549631.html 平常都是无脑使用backward,每次看到别人的代码里使用诸如autograd.grad这种方法的时候就有点抵触,今天花了点时间了解了一下原理,写下笔记以供以后参考。以下笔记基于Pytorch1. 阅读全文
posted @ 2020-12-15 14:42 笨喵敲代码 阅读(1189) 评论(0) 推荐(0)