зеркало из https://github.com/microsoft/caffe.git
stochastic pooling: avoid nan
This commit is contained in:
Родитель
9563a78b21
Коммит
c8e7cce731
|
@ -120,7 +120,8 @@ __global__ void StoPoolForwardTest(const int nthreads,
|
|||
int hend = min(hstart + ksize, height);
|
||||
int wstart = pw * stride;
|
||||
int wend = min(wstart + ksize, width);
|
||||
Dtype cumsum = 0.;
|
||||
// We set cumsum to be 0 to avoid divide-by-zero problems
|
||||
Dtype cumsum = FLT_MIN;
|
||||
Dtype cumvalues = 0.;
|
||||
bottom_data += (n * channels + c) * height * width;
|
||||
// First pass: get sum
|
||||
|
|
|
@ -287,7 +287,7 @@ void Net<Dtype>::CopyTrainedLayersFrom(const NetParameter& param) {
|
|||
DLOG(INFO) << "Ignoring source layer " << source_layer_name;
|
||||
continue;
|
||||
}
|
||||
DLOG(INFO) << "Loading source layer " << source_layer_name;
|
||||
LOG(INFO) << "Copying source layer " << source_layer_name;
|
||||
vector<shared_ptr<Blob<Dtype> > >& target_blobs =
|
||||
layers_[target_layer_id]->blobs();
|
||||
CHECK_EQ(target_blobs.size(), source_layer.blobs_size())
|
||||
|
|
Загрузка…
Ссылка в новой задаче