当前位置:网站首页>Pytorch Notebook. Nn. Batchnorm1d
Pytorch Notebook. Nn. Batchnorm1d
2022-06-30 10:43:00 【Uqi - liuwj】
1 Introduction aux principaux paramètres
torch.nn.BatchNorm1d(num_features, eps=1e-05)| num_features | Dimensions des données nécessitant une normalisation,Généralement égal àdim_hid |
| eps | Valeur ajoutée au dénominateur,Pour assurer la stabilité numérique |
2 num_featureAnalyse
batch normalizationC'est vrai.batchChaque dimension est normalisée séparément

Prenons un exemple.:
a=torch.Tensor([[1,1,1],
[2,-3,5],
[0.1,-0.3,0.5],
[1.2,-1.3,1.5]])
f1=torch.nn.BatchNorm1d(3)
f2=torch.nn.BatchNorm1d(4)
print(a,'\n',f1(a),'\n',f2(a.T))
'''
tensor([[ 1.0000, 1.0000, 1.0000],
[ 2.0000, -3.0000, 5.0000],
[ 0.1000, -0.3000, 0.5000],
[ 1.2000, -1.3000, 1.5000]])
tensor([[-0.1110, 1.3003, -0.5657],
[ 1.3685, -1.4372, 1.6971],
[-1.4425, 0.4106, -0.8485],
[ 0.1849, -0.2738, -0.2828]], grad_fn=<NativeBatchNormBackward0>)
tensor([[ 0.0000e+00, 2.0203e-01, 2.2812e-08, 5.8423e-01],
[ 0.0000e+00, -1.3132e+00, -1.2247e+00, -1.4075e+00],
[ 0.0000e+00, 1.1112e+00, 1.2247e+00, 8.2323e-01]],
grad_fn=<NativeBatchNormBackward0>)
'''num_features- Oui.3,Représente chaquesampleIl y en a trois.feature, Il y a donc trois ensembles de données à normaliser.

边栏推荐
- Gd32 RT thread ota/bootloader driver function
- Input a decimal data, convert to 8, using the sequence stack
- 内存逃逸分析
- Configure Yii: display MySQL extension module verification failed
- 转卡通学习笔记
- mysql数据库基础:约束、标识列
- 7 大轻量易用的工具,给开发者减压提效,助力企业敏捷上云 | Techo Day 精彩回顾...
- I found a wave of "alchemy artifact" in the goose factory. The developer should pack it quickly
- Harvester ch1 of CKB and HNS, connection tutorial analysis
- 今晚19:00知识赋能第2期直播丨OpenHarmony智能家居项目之控制面板界面设计
猜你喜欢

马斯克推特粉丝过亿了,但他在线失联已一周

mysql数据库基础:存储过程和函数

无心剑中译狄金森《灵魂择其伴侣》

Machine learning interview preparation (I) KNN
[email protected]基于51系列单片机的智能仪器教具"/>技能梳理[email protected]基于51系列单片机的智能仪器教具

go-zero微服务实战系列(八、如何处理每秒上万次的下单请求)
![[deep learning] common methods for deep learning to detect small targets](/img/c6/8f0549864992a1554397bad16dad4d.jpg)
[deep learning] common methods for deep learning to detect small targets

Kernel linked list (general linked list) "list.h" simple version and individual comments

安徽《合肥市装配式建筑施工图审查设计深度要求》印发;河北衡水市调整装配式建筑预售许可标准

苹果高管公然“开怼”:三星抄袭 iPhone,只加了个大屏
随机推荐
【Rust日报】2021-01-23 几个新库发布
历史上的今天:微软收购 PowerPoint 开发商;SGI 和 MIPS 合并
Implementation of monitor program with assembly language
Use keil5 software to simulate and debug gd32f305 from 0
Input a decimal data, convert to 8, using the sequence stack
Leetcode question brushing (II) -- sorting (go Implementation)
Auto SEG loss: automatic loss function design
Yixian e - commerce publie un rapport trimestriel: adhérer à la R & D et à l’investissement de la marque, réaliser un développement durable et de haute qualité
Kernel linked list (general linked list) "list.h" simple version and individual comments
ArcGIS Pro脚本工具(6)——修复CAD图层数据源
敏捷开发: 超级易用水桶估计系统
The rising star of Goldshell STC box
Using LVM to resize partitions
Gd32 RT thread flash driver function
文件共享服务器
Agile Development: super easy to use bucket estimation system
Jinbei LT6 is powerful in the year of the tiger, making waves
Apple's 5g chip was revealed to have failed in research and development, and the QQ password bug caused heated discussion. Wei Lai responded to the short selling rumors. Today, more big news is here
[rust weekly database] num bigint - large integer
机器学习面试准备(一)KNN