更新时间:2023-02-26 18:57:12
当您使用 Dropout
时会发生这种情况,因为训练和测试时的行为不同.
This happens when you use Dropout
, since the behaviour when training and testing are different.
在训练时,特征的百分比设置为零(在您的情况下为 50%,因为您使用的是 Dropout(0.5)
).测试时,使用所有功能(并适当缩放).因此,测试时的模型更加稳健 - 并且可以带来更高的测试准确度.
When training, a percentage of the features are set to zero (50% in your case since you are using Dropout(0.5)
). When testing, all features are used (and are scaled appropriately). So the model at test time is more robust - and can lead to higher testing accuracies.