From da6c40fa6ac4e35118e0e37fe4abdbd11aed9cba Mon Sep 17 00:00:00 2001 From: Yangqing Jia Date: Wed, 9 Oct 2013 10:57:02 -0700 Subject: [PATCH] misc update. Moved the data to caffe/src/ and will not store it in the repo any more. changed the pooling behavior so now ave pooling runs according to the pooling region size. --- src/caffe/layers/pooling_layer.cpp | 17 +-- src/caffe/layers/pooling_layer.cu | 14 ++- src/caffe/test/data/lena_256.jpg | Bin 12267 -> 0 bytes src/caffe/test/data/lenet.prototxt | 123 -------------------- src/caffe/test/data/lenet_test.prototxt | 124 --------------------- src/caffe/test/data/lenet_traintest.prototxt | 124 --------------------- src/caffe/test/data/linear_regression.prototxt | 34 ------ src/caffe/test/data/mnist.py | 30 ----- src/caffe/test/data/simple_conv.prototxt | 18 --- .../test/data/simple_linear_regression_data.py | 16 --- src/caffe/test/test_net_proto.cpp | 2 +- src/caffe/test/test_simple_conv.cpp | 4 +- src/caffe/test/test_solver_linear_regression.cpp | 2 +- src/programs/demo_mnist.cpp | 6 +- src/programs/train_alexnet.cpp | 4 +- 15 files changed, 23 insertions(+), 495 deletions(-) delete mode 100644 src/caffe/test/data/lena_256.jpg delete mode 100644 src/caffe/test/data/lenet.prototxt delete mode 100644 src/caffe/test/data/lenet_test.prototxt delete mode 100644 src/caffe/test/data/lenet_traintest.prototxt delete mode 100644 src/caffe/test/data/linear_regression.prototxt delete mode 100644 src/caffe/test/data/mnist.py delete mode 100644 src/caffe/test/data/simple_conv.prototxt delete mode 100644 src/caffe/test/data/simple_linear_regression_data.py diff --git a/src/caffe/layers/pooling_layer.cpp b/src/caffe/layers/pooling_layer.cpp index e8bc9b7..7de2a64 100644 --- a/src/caffe/layers/pooling_layer.cpp +++ b/src/caffe/layers/pooling_layer.cpp @@ -92,6 +92,8 @@ void PoolingLayer::Forward_cpu(const vector*>& bottom, bottom_data[h * WIDTH_ + w]; } } + top_data[ph * POOLED_WIDTH_ + pw] /= + (hend - hstart) * (wend - wstart); } } // compute offset @@ -99,12 +101,6 @@ void PoolingLayer::Forward_cpu(const vector*>& bottom, top_data += (*top)[0]->offset(0, 1); } } - // Our implementation simply divides the pooled values by KSIZE^2, - // regardless of the actual pooling region. This would allow one to not - // trust too much on the border pooling regions, but I am not sure what - // benefit / harm it would bring to the actual code. - caffe_scal(top_count, Dtype(1.) / KSIZE_ / KSIZE_, - (*top)[0]->mutable_cpu_data()); break; default: LOG(FATAL) << "Unknown pooling method."; @@ -164,10 +160,11 @@ Dtype PoolingLayer::Backward_cpu(const vector*>& top, int wstart = pw * STRIDE_; int hend = min(hstart + KSIZE_, HEIGHT_); int wend = min(wstart + KSIZE_, WIDTH_); + int poolsize = (hend - hstart) * (wend - wstart); for (int h = hstart; h < hend; ++h) { for (int w = wstart; w < wend; ++w) { bottom_diff[h * WIDTH_ + w] += - top_diff[ph * POOLED_WIDTH_ + pw]; + top_diff[ph * POOLED_WIDTH_ + pw] / poolsize; } } } @@ -179,12 +176,6 @@ Dtype PoolingLayer::Backward_cpu(const vector*>& top, top_diff += top[0]->offset(0, 1); } } - // Our implementation simply divides the pooled values by KSIZE^2, - // regardless of the actual pooling region. This would allow one to not - // trust too much on the border pooling regions, but I am not sure what - // benefit / harm it would bring to the actual code. - caffe_scal((*bottom)[0]->count(), Dtype(1.) / KSIZE_ / KSIZE_, - (*bottom)[0]->mutable_cpu_diff()); break; default: LOG(FATAL) << "Unknown pooling method."; diff --git a/src/caffe/layers/pooling_layer.cu b/src/caffe/layers/pooling_layer.cu index 3e0cb38..43d1ab5 100644 --- a/src/caffe/layers/pooling_layer.cu +++ b/src/caffe/layers/pooling_layer.cu @@ -61,7 +61,7 @@ __global__ void AvePoolForward(const int nthreads, const Dtype* bottom_data, aveval += bottom_data[h * width + w]; } } - top_data[index] = aveval / ksize / ksize; + top_data[index] = aveval / (hend - hstart) / (wend - wstart); } // (if index < nthreads) } @@ -109,7 +109,7 @@ __global__ void MaxPoolBackward(const int nthreads, const Dtype* bottom_data, int pwstart = (w < ksize) ? 0 : (w - ksize) / stride + 1; int pwend = min(w / stride + 1, pooled_width); Dtype gradient = 0; - Dtype bottom_datum = + Dtype bottom_datum = bottom_data[((n * channels + c) * height + h) * width + w]; top_data += (n * channels + c) * pooled_height * pooled_width; top_diff += (n * channels + c) * pooled_height * pooled_width; @@ -146,10 +146,16 @@ __global__ void AvePoolBackward(const int nthreads, const Dtype* top_diff, top_diff += (n * channels + c) * pooled_height * pooled_width; for (int ph = phstart; ph < phend; ++ph) { for (int pw = pwstart; pw < pwend; ++pw) { - gradient += top_diff[ph * pooled_width + pw]; + // figure out the pooling size + int poolsize = (min(ph * stride + ksize, height) - ph * stride) * + (min(pw * stride + ksize, width) - pw * stride); + if (poolsize <= 0) { + printf("error: %d %d %d %d %d\n", ph, pw, ksize, height, width); + } + gradient += top_diff[ph * pooled_width + pw] / poolsize; } } - bottom_diff[index] = gradient / ksize / ksize; + bottom_diff[index] = gradient; } // (if index < nthreads) } diff --git a/src/caffe/test/data/lena_256.jpg b/src/caffe/test/data/lena_256.jpg deleted file mode 100644 index 7b834b6b912b11d8539a009ab027fcab38875277..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12267 zcmbW7Ra6{7_uvPYAb|h@f(3^Gg1fs0cMA?P*x-`j?t|;#Zb1eo5P}AGclY4IH{XBl zoPFBe+o$WHyQ)t8?tQpcuM4jmfVYaW3bFtM1ONcx-vfAE21o(WQBl!QQP9!Q&@eF2 zF|i1+vEIDFBEf%$OF&LaNkL9ZMn*-;#y~~QLPJKz$j8LO&cV&iP01i2!p|wp#>LI~ zpG^=jFfg#*U=d?u6LWqf`^fqKEU(=FJoNvZ2?>E3fQW~Hgop6j3!waWP85Xy62Siu z1Vkic6jU^H49qwGCcxhU5D}1&5Rs8kP>_-T&Hnc9KL8mI1^*+51nN6=Gc;-l0cRjI zADu?B?kAzfVPcjP@Tc1Vqn&FA^Ry%0~`VdrvpZEq+>t*=88@PAxm!oYPlPE@NRCxdV-ju2!yUO}TwLV`9Jm!S&4y-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aikz0T4_A^JTPt1jhp>DYo*JN6s>wtT7O52Ply@vx5Mb1&WGII;b{)5KI zVoI2|dcwB~FY`g|vG=7s=f#!~5xvwu@ux`db~d9P_xUS17N2WXTfF`l2w?2DP(Fj) zv*~I~c7HBovF=gc26T&6%q%Gfjm=t`Wv`rC-F(22F_0EYwm|>b1f7XkNY5F#-;c|c zG8B|XI!%-OJso`O&bcHy(5dt@Gf5jGC^Nsk-mc^X*UBS7A~EJ3z&G*+fIAyZ^^br_FH$ zzo5qaP;G!3D)Ukd<`tc8echpKN;7Trn?N0c7%il^Vl)70&t4O~NqQ+~j3&ZexnJXu zrJg`{c>#zw_^)P)vmG95^aLNx{ajyFhz0%kO=97>l!j|U2tT-YJ+dAc^Eck^CElWp zagUEffFd0F5I@&e>Df)F)TiUWMDhMdh|883hhOFRb@klAR`717aP6~8R3&|SGnPvS zX6oW^Gd;7mFHv)`d;=+Do;-zV)It{CLLdAn=BgS^ak#lG2Q!vZ`oRzI+m^o>zq?C6 zqDdH(jFvLc#NFh6rIuTe$Ls`?Lc+!PG;LHN1hc4V60F?}9Qr<|1!_o lena_image; - ReadImageToBlob(string("caffe/test/data/lena_256.jpg"), &lena_image); + ReadImageToBlob(string("data/lena_256.jpg"), &lena_image); vector*> bottom_vec; bottom_vec.push_back(&lena_image); diff --git a/src/caffe/test/test_solver_linear_regression.cpp b/src/caffe/test/test_solver_linear_regression.cpp index f368908..fbd53f3 100644 --- a/src/caffe/test/test_solver_linear_regression.cpp +++ b/src/caffe/test/test_solver_linear_regression.cpp @@ -30,7 +30,7 @@ TYPED_TEST(SolverTest, TestSolve) { Caffe::set_mode(Caffe::GPU); NetParameter net_param; - ReadProtoFromTextFile("caffe/test/data/linear_regression.prototxt", + ReadProtoFromTextFile("data/linear_regression.prototxt", &net_param); // check if things are right EXPECT_EQ(net_param.layers_size(), 3); diff --git a/src/programs/demo_mnist.cpp b/src/programs/demo_mnist.cpp index e5712a8..6d15d75 100644 --- a/src/programs/demo_mnist.cpp +++ b/src/programs/demo_mnist.cpp @@ -21,7 +21,7 @@ int main(int argc, char** argv) { Caffe::set_mode(Caffe::GPU); NetParameter net_param; - ReadProtoFromTextFile("caffe/test/data/lenet.prototxt", + ReadProtoFromTextFile("data/lenet.prototxt", &net_param); vector*> bottom_vec; Net caffe_net(net_param, bottom_vec); @@ -58,7 +58,7 @@ int main(int argc, char** argv) { caffe_net.ToProto(&trained_net_param); NetParameter traintest_net_param; - ReadProtoFromTextFile("caffe/test/data/lenet_traintest.prototxt", + ReadProtoFromTextFile("data/lenet_traintest.prototxt", &traintest_net_param); Net caffe_traintest_net(traintest_net_param, bottom_vec); caffe_traintest_net.CopyTrainedLayersFrom(trained_net_param); @@ -75,7 +75,7 @@ int main(int argc, char** argv) { LOG(ERROR) << "Train accuracy:" << train_accuracy; NetParameter test_net_param; - ReadProtoFromTextFile("caffe/test/data/lenet_test.prototxt", &test_net_param); + ReadProtoFromTextFile("data/lenet_test.prototxt", &test_net_param); Net caffe_test_net(test_net_param, bottom_vec); caffe_test_net.CopyTrainedLayersFrom(trained_net_param); diff --git a/src/programs/train_alexnet.cpp b/src/programs/train_alexnet.cpp index 6b2260a..2063efd 100644 --- a/src/programs/train_alexnet.cpp +++ b/src/programs/train_alexnet.cpp @@ -33,9 +33,9 @@ int main(int argc, char** argv) { LOG(ERROR) << "Initial loss: " << caffe_net.Backward(); SolverParameter solver_param; - solver_param.set_base_lr(0.002); + solver_param.set_base_lr(0.001); solver_param.set_display(1); - solver_param.set_max_iter(600000); + solver_param.set_max_iter(60000); solver_param.set_lr_policy("fixed"); solver_param.set_momentum(0.9); solver_param.set_weight_decay(0.0005); -- 2.7.4