当前位置:网站首页>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 :
边栏推荐
- Basic knowledge of MySQL database (an introduction to systematization)
- [keil5 debugging] warning:enumerated type mixed with other type
- Mysql database underlying foundation column
- [Li Kou brush question notes (II)] special skills, module breakthroughs, classification and summary of 45 classic questions, and refinement in continuous consolidation
- Project cost management__ Plan value_ Earned value_ Relationship among actual cost and Countermeasures
- Application of 51 single chip microcomputer timer
- 2021-10-28
- El table X-axis direction (horizontal) scroll bar slides to the right by default
- Design of charging pile mqtt transplantation based on 4G EC20 module
- Sending and interrupt receiving of STM32 serial port
猜你喜欢

Adaptiveavgpool1d internal implementation

学历是一张通行证,门票,你有了它,可以踏入更高层次的环境里

2021-10-27

Idea remote breakpoint debugging jar package project

Seven sorting of ten thousand words by hand (code + dynamic diagram demonstration)

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

Serial communication based on 51 single chip microcomputer

Installation and removal of MySQL under Windows

Project cost management__ Topic of comprehensive calculation

Working mode of 80C51 Serial Port
随机推荐
内存数据库究竟是如何发挥内存优势的?
Runtime. getRuntime(). GC () and runtime getRuntime(). The difference between runfinalization()
ADS simulation design of class AB RF power amplifier
All processes of top ten management in project management
Which language should I choose to program for single chip microcomputer
(2)接口中新增的方法
对于新入行的同学,如果你完全没有接触单片机,建议51单片机入门
Design of charging pile mqtt transplantation based on 4G EC20 module
Installation and removal of MySQL under Windows
Windows下MySQL的安装和删除
Crash工具基本使用及实战分享
Yocto technology sharing phase IV: customize and add software package support
01仿B站项目业务架构
Fundamentals of Electronic Technology (III)__ Logic gate symbols in Chapter 5
使用sed替换文件夹下文件
Application of 51 single chip microcomputer timer
JS基础-原型原型链和宏任务/微任务/事件机制
单片机现在可谓是铺天盖地,种类繁多,让开发者们应接不暇
SSB Introduction (PbCH and DMRs need to be supplemented)
Getting started with JMX, MBean, mxbean, mbeanserver