gpt4 book ai didi

tensorflow - Dropout 层在测试/训练阶段的行为

转载 作者:行者123 更新时间:2023-12-04 08:55:42 25 4
gpt4 key购买 nike

根据 Keras 文档,dropout 层在训练和测试阶段表现出不同的行为:

Note that if your model has a different behavior in training and testing phase (e.g. if it uses Dropout, BatchNormalization, etc.), you will need to pass the learning phase flag to your function:



不幸的是,没有人谈论实际差异。为什么 dropout 在测试阶段会有不同的表现?我希望层将一定数量的神经元设置为 0。为什么这种行为取决于训练/测试阶段?

最佳答案

Dropout 用于训练阶段,以减少过拟合的机会。正如您提到的,这一层会停用某些神经元。该模型将对其他节点的权重变得更加不敏感。基本上对于 dropout 层,训练模型将是许多细化模型的平均值。查看更详细的解释here

但是,在应用经过训练的模型时,您希望使用模型的全部功能。您想使用经过训练的(平均)网络中的所有神经元来获得最高准确度。

关于tensorflow - Dropout 层在测试/训练阶段的行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43887706/

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