当前位置:网站首页>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 :
边栏推荐
- There is no shortcut to learning and development, and there is almost no situation that you can learn faster by leading the way
- 4G module at command communication package interface designed by charging pile
- Raspberry pie installation SciPy
- 我想各位朋友都应该知道学习的基本规律就是:从易到难
- Seven sorting of ten thousand words by hand (code + dynamic diagram demonstration)
- Interruption system of 51 single chip microcomputer
- Project cost management__ Cost management technology__ Article 7 completion performance index (tcpi)
- [untitled] proteus simulation of traffic lights based on 89C51 Single Chip Microcomputer
- 嵌入式本来就很坑,相对于互联网来说那个坑多得简直是难走
- 要选择那种语言为单片机编写程序呢
猜你喜欢

Project cost management__ Topic of comprehensive calculation

编程思想比任何都重要,不是比谁多会用几个函数而是比程序的理解

Swing transformer details-2

Interruption system of 51 single chip microcomputer

03 FastJson 解决循环引用

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

内存数据库究竟是如何发挥内存优势的?

Not many people can finally bring their interests to college graduation

2021-10-28

內存數據庫究竟是如何發揮內存優勢的?
随机推荐
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
I didn't think so much when I was in the field of single chip microcomputer. I just wanted to earn money to support myself first
Development of intelligent charging pile (I): overview of the overall design of the system
The 4G module designed by the charging pile obtains NTP time through mqtt based on 4G network
Fundamentals of Electronic Technology (III)__ Logic gate symbols in Chapter 5
Vector processor 9_ Basic multilevel interconnection network
Oracle数据库 SQL语句执行计划、语句跟踪与优化实例
Eight working modes of stm32gpio and chip naming rules
新系列单片机还延续了STM32产品家族的低电压和节能两大优势
自動裝箱與拆箱了解嗎?原理是什麼?
Mysql database underlying foundation column
Yocto technology sharing phase IV: customize and add software package support
4G module initialization of charge point design
Fundamentals of Electronic Technology (III)__ Fundamentals of circuit analysis__ Basic amplifier operating principle
(2) New methods in the interface
Design of charging pile mqtt transplantation based on 4G EC20 module
C language enumeration type
Yocto Technology Sharing Phase 4: Custom add package support
SSB Introduction (PbCH and DMRs need to be supplemented)
2. Elment UI date selector formatting problem