当前位置:网站首页>Pytorch notes torch nn. BatchNorm1d
Pytorch notes torch nn. BatchNorm1d
2022-06-30 10:43:00 【UQI-LIUWJ】
1 The main parameters are introduced
torch.nn.BatchNorm1d(num_features, eps=1e-05)| num_features | Data dimensions that need to be normalized , Generally equal to dim_hid |
| eps | Value added to the denominator , To ensure numerical stability |
2 num_feature analysis
batch normalization Yes, one. batch Each dimension is normalized separately

For example :
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 yes 3, Represent each sample There are three feature, Then there are three groups of data to be normalized respectively

边栏推荐
- Android 开发面试真题进阶版(附答案解析)
- Implementation of monitor program with assembly language
- Enter the world of helium (hNT) hotspot servers to bring you different benefits
- 【Rust日报】2021-01-22 首份Rust月刊杂志邀请大家一起参与
- Compare the maximum computing power of the Cenozoic top ant s19xp and the existing s19pro in bitland
- Implementation of iterative method for linear equations
- CSDN博客运营团队2022年H1总结
- pytorch 笔记:validation ,model.eval V.S torch.no_grad
- [rust weekly database] num bigint - large integer
- How to deploy deflationary combustion destruction contract code in BSC chain_ Deploy dividend and marketing wallet contract code
猜你喜欢

Harvester ch1 of CKB and HNS, connection tutorial analysis

Musk has more than 100 million twitter fans, but he has been lost online for a week

CVPR 2022 | 清华&字节&京东提出BrT:用于视觉和点云3D目标检测的桥接Transformer

How to seize the opportunity of NFT's "chaos"?

再测云原生数据库性能:PolarDB依旧最强,TDSQL-C、GaussDB变化不大

Robotframework learning notes: environment installation and robotframework browser plug-in installation

CSDN blog operation team 2022 H1 summary

"Kunming City coffee map" was opened again, and coffee brought the city closer

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

Kernel linked list (general linked list) "list.h" simple version and individual comments
随机推荐
程序员需知的 59 个网站
数学知识复习:第二型曲线积分
[deep learning] common methods for deep learning to detect small targets
Ant s19xp appeared in 140t, why is it called the computing power ceiling by the world
Turn to cartoon learning notes
【Rust日报】2021-01-22 首份Rust月刊杂志邀请大家一起参与
Enter the world of helium (hNT) hotspot servers to bring you different benefits
Using LVM to resize partitions
技能梳理[email protected]在oled上控制一条狗的奔跑
GD32 RT-Thread PWM驱动函数
Smith chart view of semi steel coaxial RF line and RF line matching calibration of network analyzer e5071c
"Kunming City coffee map" was opened again, and coffee brought the city closer
运动App如何实现端侧后台保活,让运动记录更完整?
js常见问题
TypeScript–es5中的类,继承,静态方法
Compétences Comb 27 @ Body sense Manipulator
JS FAQs
Anhui "requirements for design depth of Hefei fabricated building construction drawing review" was printed and distributed; Hebei Hengshui city adjusts the pre-sale license standard for prefabricated
技能梳理[email protected]语音模块+stm32+nfc
敏捷开发: 超级易用水桶估计系统