当前位置:网站首页>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.

边栏推荐
- How to seize the opportunity of NFT's "chaos"?
- 安徽《合肥市装配式建筑施工图审查设计深度要求》印发;河北衡水市调整装配式建筑预售许可标准
- Curl --- the request fails when the post request parameter is too long (more than 1024b)
- GD32 RT-Thread PWM驱动函数
- 【Proteus仿真】Arduino UNO LED模拟交通灯
- Viewing technological changes through Huawei Corps (V): smart Park
- 内存逃逸分析
- 技能梳理[email protected]语音模块+stm32+nfc
- 微信推出图片大爆炸功能;苹果自研 5G 芯片或已失败;微软解决导致 Edge 停止响应的 bug|极客头条...
- 同事的接口文档我每次看着就头大,毛病多多。。。
猜你喜欢

Migrate full RT thread to gd32f4xx (detailed)

Koreano essential creates a professional style
[email protected]在oled上控制一条狗的奔跑"/>技能梳理[email protected]在oled上控制一条狗的奔跑

Dow Jones Industrial Average

Arm新CPU性能提升22%,最高可组合12核,GPU首配硬件光追,网友:跟苹果的差距越来越大了...
[email protected]+ Alibaba cloud +nbiot+dht11+bh1750+ soil moisture sensor +oled"/>Skill sorting [email protected]+ Alibaba cloud +nbiot+dht11+bh1750+ soil moisture sensor +oled

Yixian e-commerce released its first quarterly report: adhere to R & D and brand investment to achieve sustainable and high-quality development

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

matplotlib 笔记: contourf & contour

Kernel linked list (general linked list) "list.h" simple version and individual comments
随机推荐
What is the real performance of CK5, the king machine of CKB?
Who should the newly admitted miners bow to in front of the chip machine and the graphics card machine
技能梳理[email protected]+adxl345+电机震动+串口输出
Criu enables hot migration
[deep learning] common methods for deep learning to detect small targets
超长干货 | Kubernetes命名空间详解
【Rust日报】2021-01-23 几个新库发布
CSDN博客运营团队2022年H1总结
June training (day 30) - topology sorting
Foresniffer tutorial: extracting data
GD32 RT-Thread PWM驱动函数
7 大轻量易用的工具,给开发者减压提效,助力企业敏捷上云 | Techo Day 精彩回顾...
前嗅ForeSpider教程:抽取数据
今晚19:00知识赋能第2期直播丨OpenHarmony智能家居项目之控制面板界面设计
技能梳理[email protected]基于51系列单片机的智能仪器教具
Didi open source agile test case management platform!
Leetcode question brushing (II) -- sorting (go Implementation)
Pandora IOT development board learning (HAL Library) - Experiment 1 running lantern (RGB) experiment (learning notes)
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é
[rust weekly database] num bigint - large integer