totensor
:
[
0
,
255
]
÷
255
=
[
0
,
1
]
[0,255]÷255=[0,1]
[0,255]÷255=[0,1]normalize:
[
0
,
1
]
−
0.5
0.5
=
[
−
1
,
1
]
\frac{[0,1]-0.5}{0.5}=[-1,1]
0.5[0,1]−0.5=[−1,1]unnormalize:
(
[
−
1
,
1
]
×
0.5
+
0.5
)
×
255
=
[
0
,
255
]
([-1,1]×0.5+0.5)×255=[0,255]
([−1,1]×0.5+0.5)×255=[0,255]
Pytorch对输入的归一化
最新推荐文章于 2024-08-29 23:21:49 发布