当前位置:网站首页>Pytoch learning record (x): data preprocessing + batch normalization (BN)
Pytoch learning record (x): data preprocessing + batch normalization (BN)
2022-04-23 05:51:00 【Zuo Xiaotian ^ o^】
Data preprocessing
At present, the most common method of data preprocessing is centralization and standardization , Centralization is equivalent to correcting the central position of data , The implementation is very simple , It is to subtract the corresponding mean value from each feature dimension , Finally get 0 mean value () The pixel range is [-128,127], With 0 Centered Characteristics of . Standardization is also very simple , When the data becomes 0 After mean , In order to make different feature dimensions have the same scale , It can be divided by the standard deviation to approximate a normal distribution , It can also be converted to... Based on the maximum and minimum values -1 ~ 1 Between .
Batch Normalization The batch (BN)
Batch of standardized , In short , It is the output of each layer of network , Make a normalization of it , Make it obey the standard normal distribution , In this way, the input of the latter layer network is also a standard normal distribution , So I can train better , Speed up convergence .
The first and second lines calculate a batch Mean and variance of data in , Then use the third formula to batch Standardize each data point in the , 𝜖 A small constant introduced to calculate stability , Usually take 10−5 , Finally, the final output result is obtained by weight correction , Very simple , Now we can realize a simple one-dimensional case , That is, the situation in neural networks
https://www.cnblogs.com/yongjieShi/p/9332655.html
https://zhuanlan.zhihu.com/p/69431151
nn.BatchNorm2d
from torch import nn
import torch
m = nn.BatchNorm2d(3) # bn The parameters set are actually channel Parameters of
input = torch.randn(4, 3, 2, 2)
output = m(input)
版权声明
本文为[Zuo Xiaotian ^ o^]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230543244052.html
边栏推荐
- refused connection
- Range of numbers (dichotomous classic template topic)
- Understand the current commonly used encryption technology system (symmetric, asymmetric, information abstract, digital signature, digital certificate, public key system)
- MySQL query uses \ g, column to row
- Hotkeys, interface visualization configuration (interface interaction)
- PyQy5学习(四):QAbstractButton+QRadioButton+QCheckBox
- Multithreading and high concurrency (3) -- synchronized principle
- 事实最终变量与最终变量
- SQL注入
- JVM系列(3)——内存分配与回收策略
猜你喜欢
引航成长·匠心赋能——YonMaster开发者培训领航计划全面开启
JVM series (3) -- memory allocation and recycling strategy
2-軟件設計原則
AcWing 836. Merge set (merge set)
Flutter 新一代图形渲染器 Impeller
Common protocols of OSI layer
mysql sql优化之Explain
图解HashCode存在的意义
Multithreading and high concurrency (3) -- synchronized principle
PyQy5学习(三):QLineEdit+QTextEdit
随机推荐
js数字大写方法
给yarn配置国内镜像加速器
mysql sql优化之Explain
AcWing 1096. Detailed notes of Dungeon Master (3D BFS) code
PreparedStatement防止SQL注入
创建企业邮箱账户命令
JVM family (4) -- memory overflow (OOM)
【华为机试】考试得分总数(如何处理答错的情况?回溯一次,代表答错一题)
事实最终变量与最终变量
The role of brackets' [] 'in the parameter writing method in MDN documents
DBCP使用
Character recognition easyocr
Strategy for improving the conversion rate of independent stations | recovering abandoned users
Transposed convolution
Introduction to data security -- detailed explanation of database audit system
JDBC连接数据库
Golang implements Ping connectivity detection case through exec module
一文读懂当前常用的加密技术体系(对称、非对称、信息摘要、数字签名、数字证书、公钥体系)
The 8th Blue Bridge Cup 2017 - frog jumping cup
编写一个自己的 RedisTemplate