赞
踩
通用视觉框架OpenMMLab——图像分类与MMClassification
目录
1.3.1 卷积层 (Convolutional Layer)
1.3.7 归一化层(Normalization Layer)
1.3.8 全连接层(Fully Connected Layer)
2.2 GoogleNet、ResNet、ResNeXt网络
2.3 SENet、MobileNet、ShuffleNet
原则1:卷积核的通道数与输入图像的通道数相同
原则2:输出特征图的通道数与卷积核的个数相同
- # Functional API
- img = torch.randn(1.3.8.12) # N,C,H,W
- weight = torch.randn(6,3,3,3) # C',C,K,K
- bias = torch.randn(6) # C'
- out = F.conv2d(img,weight,bias,padding=1)
-
- # Class API
- conv = nn.Conv2d(3,6,kernel_size=(3,3),padding=1) #C,C'
- img = torch.randn(1,3,8,12) # N,C,H,W
- y = conv(img)
- x = torch.randn(3,3)
- # Functional API
- y = F.relu(x)
- # Class API
- relu = nn.ReLU()
- y = relu(x)
- x = torch.randn(1,1,4,4)
- # Functional API
- y = F.max_pool2s(x,kernel_size = 2,stride=2)
- # Class API
- pool = nn.MaxPool2d(kernel_size=(2,2),stride=2)
- y = pool(x)
- # Vectorize
- fmap = torch.randn(1,2,2,2)
- x = fmap.view(-1,8)
-
- # Functional API
- weight = torch.randn(6,8)
- bias = torch.randn(6)
- y = F.linear(x,weight,bias)
-
- # Class API
- linear = nn.Linear(8,6) # in_features=8,out_features=6
- y = linear(x)
- z = torch.rand(3)
- # Functional API
- p = F.softmax(z)
-
- # Class API
- s = nn.Softmax()
- p = s(z)
主要介绍以下网络:LeNet-5(1998),AlexNet(2012),VGGNet(2014),GoogleNet(Inception,2014)ResNet(2015),ResNeXt(2017),SENet(2017),MobileNet(2017),ShuffleNet(2017)的设计思路变化过程
赞
踩
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。