问题描述
在caffe的AlexNet实现中,我在deploy.prototxt文件中看到以下层:
In the AlexNet implementation in caffe, I saw the following layer in the deploy.prototxt file:
layer {
name: "drop7"
type: "Dropout"
bottom: "fc7"
top: "fc7"
dropout_param {
dropout_ratio: 0.5
}
}
现在,退出的关键思想是随机删除单位(以及
Now the key idea of dropout is to randomly drop units (along with their connections) from the neural network during training.
这是否意味着我可以简单地从deploy.prototxt中删除该层,因为该文件将在测试期间使用只要?
Does this mean that I can simply delete this layer from deploy.prototxt, as this file is meant to be used during testing only?
推荐答案
是。在测试过程中不需要退出。
Yes. Dropout is not required during Testing.
即使您包括一个退出层,在测试过程中也不会发生任何特殊情况。请参见辍学前向通行证的源代码:
Even if you include a dropout layer, nothing special happens during Testing. See the source code of dropout forward pass:
if (this->phase_ == TRAIN) {
// Code to do something
} else {
caffe_copy(bottom[0]->count(), bottom_data, top_data); //Code to copy bottom blob to top blob
}
如源代码所示,如果底部Blob数据不在训练阶段,则会将其复制到顶部Blob数据存储器中。
As seen in the source code, the bottom blob data is copied to top blob data memory if its not on Training phase.
这篇关于是否需要在caffe的deploy.prototxt中定义退出层?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!