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

边栏推荐
- 从0使用keil5软件仿真调试GD32F305
- Viewing technological changes through Huawei Corps (V): smart Park
- June training (day 30) - topology sorting
- Getting started with X86 - take over bare metal control
- WGet -- 404 not found due to spaces in URL
- The rising star of Goldshell STC box
- Voir le changement technologique à travers la Légion Huawei (5): Smart Park
- Circuit breaker hystrixcircuitbreaker
- Curl --- the request fails when the post request parameter is too long (more than 1024b)
- Gd32 RT thread RTC driver function
猜你喜欢

ArcGIS Pro + PS 矢量化用地规划图

腾讯云数据库工程师能力认证重磅推出,各界共话人才培养难题

Remember the experience of an internship. It is necessary to go to the pit (I)

我在鹅厂淘到了一波“炼丹神器”,开发者快打包

苹果5G芯片被曝研发失败,QQ密码bug引热议,蔚来回应做空传闻,今日更多大新闻在此...

CSDN博客运营团队2022年H1总结

Use keil5 software to simulate and debug gd32f305 from 0

逸仙電商發布一季報:堅持研發及品牌投入,實現可持續高質量發展

Using LVM to resize partitions
[email protected] voice module +stm32+nfc"/>Skill combing [email protected] voice module +stm32+nfc
随机推荐
Remember the experience of an internship. It is necessary to go to the pit (I)
Configure Yii: display MySQL extension module verification failed
ArcGIS Pro脚本工具(6)——修复CAD图层数据源
7 大轻量易用的工具,给开发者减压提效,助力企业敏捷上云 | Techo Day 精彩回顾...
Migrate full RT thread to gd32f4xx (detailed)
Foresniffer tutorial: extracting data
Dow Jones Industrial Average
透過華為軍團看科技之變(五):智慧園區
Highlight display of Jinbei LB box, adhering to mini special effects
Ionic4 drag the ion reorder group component to change the item order
"Kunming City coffee map" was opened again, and coffee brought the city closer
苹果5G芯片被曝研发失败,QQ密码bug引热议,蔚来回应做空传闻,今日更多大新闻在此...
Leetcode question brushing (II) -- sorting (go Implementation)
无心剑中译狄金森《灵魂择其伴侣》
Arm新CPU性能提升22%,最高可组合12核,GPU首配硬件光追,网友:跟苹果的差距越来越大了...
The performance of arm's new CPU has been improved by 22%, up to 12 cores can be combined, and the GPU is first equipped with hardware optical tracking. Netizen: the gap with apple is growing
Curl --- the request fails when the post request parameter is too long (more than 1024b)
Compétences Comb 27 @ Body sense Manipulator
Koreano essential creates a professional style
移植完整版RT-Thread到GD32F4XX(详细)