gpt4 book ai didi

tensorflow - 为什么relu6中是6?

转载 作者:行者123 更新时间:2023-12-03 07:45:34 24 4
gpt4 key购买 nike

我在 R 中从头开始破解了一个深度前馈神经网络,它似乎比 ReLU 更稳定,具有“硬 sigmoid”激活 - max(0,min(1,x))。尝试将其移植到 TensorFlow 中,发现他们没有内置此激活函数,只有 relu6,它使用上限为 6。这有什么原因吗?(我知道你可以做 relu6(x*6)/6,但如果 TF 的家伙把 6 放在那里有充分的理由,我想知道。)另外,我想知道其他人是否在前馈网络中遇到 ReLU 爆炸问题(我知道 RNN 问题)。

最佳答案

来自this reddit thread :

This is useful in making the networks ready for fixed-point inference. If you unbound the upper limit, you lose too many bits to the Q part of a Q.f number. Keeping the ReLUs bounded by 6 will let them take a max of 3 bits (upto 8) leaving 4/5 bits for .f

看来,6 只是根据您希望能够将网络的训练参数压缩到的位数而选择的任意值。根据“为什么”仅实现值为 6 的版本,我认为这是因为该值最适合 8 位,这可能是最常见的用例。

关于tensorflow - 为什么relu6中是6?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47220595/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com