当前位置:网站首页>RESNET code details
RESNET code details
2022-07-03 10:02:00 【Star soul is not a dream】
In order to analyze the network structure : Downloaded netron
snap install netron # System ubuntu

Above picture ,[ ] It means a block .
about 18/34 layer Resnet
block In the official code is : BasicBlock .BasicBlock according to identity whether Down sampling Divided into two . In the diagram above , The green arrow part namely conv3_1, conv4_1, and conv5_1 It's about identity Conduct Down sampling , Realization : (1x1 conv, s=2) , And double each channel . stay In the code , adopt Pass in _make_layer Of stride Is it 1 determine .

about 50/101/152 layer Resnet
block In the official code is : Bottleneck .Bottleneck according to identity whether Down sampling Divided into two . stay chart 1 in , The green arrow part namely conv3_1, conv4_1, and conv5_1 It's about identity Conduct Down sampling , Realization : (1x1 conv, s=2) , And double each channel . stay In the code , adopt Pass in _make_layer Of stride Is it 1 determine .

notes : about 50/101/152 layer Resnet, according to chart 1 We know that through 3x3 Of max pool Then output the characteristic matrix shape Should be [56, 56, 64], But we conv2_x The corresponding The output characteristic matrix of the main branch shape yes [56, 56, 256]. therefore The first level residual structure requires shape from [56, 56, 64] --> [56, 56, 256]. Be careful , Here only adjust channel dimension , The height and width remain the same ( and conv3_1, conv4_1, conv5_1 Corresponding to a series of residual structures First floor dotted line residual structure It's not just about channel double + Halve the height and width ).

Code :
if stride != 1 or self.inplanes != planes * block.expansion:
downsample = nn.Sequential(
conv1x1(self.inplanes, planes * block.expansion, stride),
nn.BatchNorm2d(planes * block.expansion),
)self.inplanes != planes * block.expansion : 64!= 64 * 4
Reference resources :
边栏推荐
- Windows下MySQL的安装和删除
- QT qcombobox QSS style settings
- [keil5 debugging] warning:enumerated type mixed with other type
- Project cost management__ Cost management technology__ Article 8 performance review
- GPIO port details, Hal library operation keys
- 4G module board level control interface designed by charging pile
- 4G module initialization of charge point design
- SCM is now overwhelming, a wide variety, so that developers are overwhelmed
- Yocto Technology Sharing Phase 4: Custom add package support
- 新系列单片机还延续了STM32产品家族的低电压和节能两大优势
猜你喜欢

51 MCU tmod and timer configuration

Timer and counter of 51 single chip microcomputer

內存數據庫究竟是如何發揮內存優勢的?

Mysql database underlying foundation column

Crash工具基本使用及实战分享

03 FastJson 解决循环引用

Not many people can finally bring their interests to college graduation

STM32 external interrupt experiment

干单片机这一行的时候根本没想过这么多,只想着先挣钱养活自己

uniapp 实现微信小程序全局分享及自定义分享按钮样式
随机推荐
2020-08-23
学习开发没有捷径,也几乎不存在带路会学的快一些的情况
is_ power_ of_ 2 judge whether it is a multiple of 2
MySQL的简单使用(增删改查)
【力扣刷题笔记(二)】特别技巧,模块突破,45道经典题目分类总结,在不断巩固中精进
学历是一张通行证,门票,你有了它,可以踏入更高层次的环境里
单片机现在可谓是铺天盖地,种类繁多,让开发者们应接不暇
Comment la base de données mémoire joue - t - elle l'avantage de la mémoire?
Project cost management__ Cost management technology__ Article 8 performance review
01仿B站项目业务架构
GPIO port details, Hal library operation keys
2020-08-23
My openwrt learning notes (V): choice of openwrt development hardware platform - mt7688
Crash工具基本使用及实战分享
STM32 port multiplexing and remapping
当你需要使用STM32某些功能,而51实现不了时, 那32自然不需要学
In third tier cities and counties, it is difficult to get 10K after graduation
Circular queue related design and implementation reference 1
Stm32f04 clock configuration
Project cost management__ Cost management technology__ Article 6 prediction