当前位置:网站首页>NN in pytoch Brief introduction to adaptive avgpool2d (output_size)
NN in pytoch Brief introduction to adaptive avgpool2d (output_size)
2022-04-21 22:56:00 【Graduate students are not late】
List of articles
1 What is pooling ?(Pooling)
- Pooling, Pooling layer , Also known as down sampling 、 Convergence layer , It is the process of re selecting samples from samples . To reduce the data dimension .
- Pooling There are two main categories :① Maximum pooling (Max pooling)② Mean pooling (Avg pooling)
The former is to take size×size The maximum . The latter is based on the average .
2 adaptivePooling and GeneralPooling
-
AdaptivePooling, Adaptive pooling layer . Using this pooling method , nucleus (kernal) And step length (stride) Is a function based on the original size of the input 、 Target size Automatic calculation Coming out .
-
GeneralPooling, Non adaptive pooling layer , You need to specify the size and step size of the core .
3 Code calls
- You don't need to implement the underlying code yourself , Can be called directly
torch.nn.AdaptiveAvgPool2d(X)
- Call in non adaptive mode
# Maximum pooling
out = nn.MaxPool2d(kernel_size=2,stride=2)
# Mean pooling
out = nn.AvgPool2d(kernel_size=2,stride=2)
- Call of adaptive mode
You just need to specifyoutput_size, A parameter represents W and H identical , You can also customize it (H,W)
# Adaptive maximum pooling
out=nn.AdaptiveAvgPool2d(output_size=100)
# Adaptive mean pooling
out=nn.AdaptiveMaxPool2d((10, 15))
版权声明
本文为[Graduate students are not late]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204212033275277.html
边栏推荐
- Outsourcing student management system detailed architecture design document
- [MQ] starting from scratch to realize mq-01-start of producers and consumers
- 6. Example of QT using MySQL
- Sorting methods (8 kinds) detailed explanation 7 - counting sorting
- 2、Failed to connect to MySQL Server 8.0.28 after 10 attempts
- 2022-04-21: given a blacklist containing non repeating integers in [0, n), write a function to return a random integer not in the blacklist from [0, n)
- MySQL read / write separation
- Industry analysis | development of Internet medicine
- [MQ] starting from scratch to realize mq-01-start of producers and consumers
- [matlab] matlab drawing operation skills
猜你喜欢

Apache Flink系列-④有状态函数

2022 hoisting machinery command test question simulation test question bank and answers

Chapter 2 installation of MySQL database

After learning the linked list, don't you find some classic examples to consolidate your knowledge? The five OJ classic examples of the linked list, can you? Let's have a look (knowledge analysis + gr

音视频基本概念和FFmpeg的简单入门

2022r2 mobile pressure vessel filling test exercises and online simulation test

小程序如何集成即构IM实现即时通讯发消息聊天

2022 TV Box plus le classement de la liste d'achat, plus de la moitié des utilisateurs achètent des boîtes dangbei

循环队列与扩容

7.3.1 homogeneous coordinate transformation & homogeneous transformation matrix
随机推荐
POI Point of interesting.
Ros2 robot modeling URDF 8.1 URDF unified robot modeling language
P1027 [NOIP2001 提高组] Car 的旅行路线 (图 最短路)
The visual chart tells you whether "the world" and "the rest of life, please give more advice" have exploded or not?
循环队列与扩容
VOS如何设置盲区
Analysis on the underlying principle of MySQL transaction and isolation level
Languages supported by markdown code blocks
AI application theory - special production and manufacturing session (parts installation and quality inspection)
2022 TV box plus purchase list ranking, more than half of users buy dangbei box
[pytorch] common functions
黑盒测试-数据的读取与输出方式
MySQL 第5章 MySQL表数据的增删改查
[Central South University of forestry science and technology] [Chen] ninth week operation triangle exception handling
6. Example of QT using MySQL
MySQL read / write separation
Go language self-study series | golang pointer
Comparison between member variables and local variables
7.4 introduction to robot kinematics | manipulator kinematics | two wheel differential chassis kinematics | wheel odometer
Black box test - data reading and output mode