当前位置:网站首页>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 :
边栏推荐
- 编程思想比任何都重要,不是比谁多会用几个函数而是比程序的理解
- Not many people can finally bring their interests to college graduation
- Oracle数据库 SQL语句执行计划、语句跟踪与优化实例
- 没有多少人能够最终把自己的兴趣带到大学毕业上
- STM32 general timer 1s delay to realize LED flashing
- My openwrt learning notes (V): choice of openwrt development hardware platform - mt7688
- SCM career development: those who can continue to do it have become great people. If they can't endure it, they will resign or change their careers
- Uniapp realizes global sharing of wechat applet and custom sharing button style
- 4G module designed by charging pile obtains signal strength and quality
- Stm32 NVIC interrupt priority management
猜你喜欢
yocto 技術分享第四期:自定義增加軟件包支持
在三线城市、在县城,很难毕业就拿到10K
It is difficult to quantify the extent to which a single-chip computer can find a job
uniapp 实现微信小程序全局分享及自定义分享按钮样式
Of course, the most widely used 8-bit single chip microcomputer is also the single chip microcomputer that beginners are most easy to learn
没有多少人能够最终把自己的兴趣带到大学毕业上
Development of intelligent charging pile (I): overview of the overall design of the system
应用最广泛的8位单片机当然也是初学者们最容易上手学习的单片机
Education is a pass and ticket. With it, you can step into a higher-level environment
Fundamentals of Electronic Technology (III)__ Logic gate symbols in Chapter 5
随机推荐
03 FastJson 解决循环引用
(1) 什么是Lambda表达式
[untitled] proteus simulation of traffic lights based on 89C51 Single Chip Microcomputer
Gpiof6, 7, 8 configuration
STM32 serial communication principle
2021-10-27
Simple use of MySQL (addition, deletion, modification and query)
Idea remote breakpoint debugging jar package project
El table X-axis direction (horizontal) scroll bar slides to the right by default
开学实验里要用到mysql,忘记基本的select语句怎么玩啦?补救来啦~
Fundamentals of Electronic Technology (III)_ Chapter 2 principle of amplification circuit__ Crystal triode and field effect triode
Exception handling of arm
STM32 serial port usart1 routine
Stm32 NVIC interrupt priority management
2021-10-28
Happy Dragon Boat Festival—— Zongzi written by canvas~~~~~
SCM career development: those who can continue to do it have become great people. If they can't endure it, they will resign or change their careers
(2)接口中新增的方法
PIP references domestic sources
我想各位朋友都应该知道学习的基本规律就是:从易到难