为什么使用softmax而不是标准归一化?
0 454
0

在神经网络的输出层中,通常使用softmax函数来近似概率分布 由于指数的原因,计算起来很耗时。为什么不简单地执行Z变换以使所有输出均为正,然后通过将所有输出除以所有输出之和来进行归一化?

收藏
2021-02-01 13:49 更新 anna •  5042
共 1 个回答
高赞 时间
0

与标准归一化相比,Softmax有一个不错的属性。

它对神经网络的低刺激(想想模糊的图像)的反应分布相当均匀,对高刺激(想想清晰的图像)的概率接近0和1。

只要比例相同,标准规范化就无关紧要。

看看soft max输入大10倍时会发生什么,即神经网络获得清晰的图像并且许多神经元被激活

>>> softmax([1,2])              # blurry image of a ferret
[0.26894142,      0.73105858])  #     it is a cat perhaps !?
>>> softmax([10,20])            # crisp image of a cat
[0.0000453978687, 0.999954602]) #     it is definitely a CAT !

然后将其与标准归一化进行比较

>>> std_norm([1,2])                      # blurry image of a ferret
[0.3333333333333333, 0.6666666666666666] #     it is a cat perhaps !?
>>> std_norm([10,20])                    # crisp image of a cat
[0.3333333333333333, 0.6666666666666666] #     it is a cat perhaps !?

Via:https://stackoverflow.com/a/45186059/14964791

收藏
2021-02-01 15:03 更新 karry •  4540