更新时间:2022-11-28 21:00:54
由于使用培训和测试的行为不同,因此在使用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.