From 2a01554143d5b368a00450303ee823431abee7ff Mon Sep 17 00:00:00 2001 From: William Song Date: Tue, 27 Jan 2015 00:20:04 -0800 Subject: [PATCH] fixes to dropout layer --- models/brody/solver_driving_softmax.prototxt | 4 +-- models/brody/solver_normalization.prototxt | 4 +-- .../train_val_driving_normalization.prototxt | 26 +++++++++---------- src/caffe/layers/dropout_fixed_layer.cpp | 3 ++- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/models/brody/solver_driving_softmax.prototxt b/models/brody/solver_driving_softmax.prototxt index 6b485896815..089cf2868f1 100644 --- a/models/brody/solver_driving_softmax.prototxt +++ b/models/brody/solver_driving_softmax.prototxt @@ -1,4 +1,4 @@ -net: "models/brody/train_val_driving_softmax.prototxt" +net: "models/brody/train_val_driving_softmax_norm.prototxt" test_iter: 20 test_interval: 5000 test_compute_loss: true @@ -11,5 +11,5 @@ max_iter: 1450000 momentum: 0.9 weight_decay: 0.00005 snapshot: 1000 -snapshot_prefix: "models/brody/driving_softmax_8x8" +snapshot_prefix: "models/brody/driving_softmax_8x8_norm" solver_mode: GPU diff --git a/models/brody/solver_normalization.prototxt b/models/brody/solver_normalization.prototxt index 74e11e8cc07..1f912ba608d 100644 --- a/models/brody/solver_normalization.prototxt +++ b/models/brody/solver_normalization.prototxt @@ -2,14 +2,14 @@ net: "models/brody/train_val_driving_normalization.prototxt" test_iter: 20 test_interval: 5000 test_compute_loss: true -base_lr: 0.0000001 +base_lr: 0.002 lr_policy: "step" gamma: 0.1 stepsize: 100000 display: 20 max_iter: 1450000 momentum: 0.9 -weight_decay: 0.00005 +weight_decay: 0.0005 snapshot: 1000 snapshot_prefix: "models/brody/driving_normalization" solver_mode: GPU diff --git a/models/brody/train_val_driving_normalization.prototxt b/models/brody/train_val_driving_normalization.prototxt index 64d46a54cee..d4a3e82fb6e 100644 --- a/models/brody/train_val_driving_normalization.prototxt +++ b/models/brody/train_val_driving_normalization.prototxt @@ -118,7 +118,7 @@ layers { bottom: "data" top: "L0" blobs_lr: 1 - blobs_lr: 2 + blobs_lr: 1 weight_decay: 1 weight_decay: 0 convolution_param { @@ -169,7 +169,7 @@ layers { bottom: "pool1" top: "L1" blobs_lr: 1 - blobs_lr: 2 + blobs_lr: 1 weight_decay: 1 weight_decay: 0 convolution_param { @@ -221,7 +221,7 @@ layers { bottom: "pool2" top: "L2" blobs_lr: 1 - blobs_lr: 2 + blobs_lr: 1 weight_decay: 1 weight_decay: 0 convolution_param { @@ -250,7 +250,7 @@ layers { bottom: "L2" top: "L3" blobs_lr: 1 - blobs_lr: 2 + blobs_lr: 1 weight_decay: 1 weight_decay: 0 convolution_param { @@ -280,7 +280,7 @@ layers { bottom: "L3" top: "L4" blobs_lr: 1 - blobs_lr: 2 + blobs_lr: 1 weight_decay: 1 weight_decay: 0 convolution_param { @@ -322,7 +322,7 @@ layers { bottom: "pool5" top: "L5" blobs_lr: 1 - blobs_lr: 2 + blobs_lr: 1 weight_decay: 1 weight_decay: 0 convolution_param { @@ -360,7 +360,7 @@ layers { bottom: "L5" top: "L6" blobs_lr: 1 - blobs_lr: 2 + blobs_lr: 1 weight_decay: 1 weight_decay: 0 convolution_param { @@ -398,7 +398,7 @@ layers { bottom: "L6" top: "bb-output" blobs_lr: 1 - blobs_lr: 2 + blobs_lr: 1 weight_decay: 1 weight_decay: 0 convolution_param { @@ -406,11 +406,11 @@ layers { kernel_size: 1 weight_filler { type: "gaussian" - std: 0.005 + std: 0.01 } bias_filler { type: "constant" - value: 1.0 + value: 0.0 } } } @@ -421,7 +421,7 @@ layers { bottom: "L6" top: "pixel-conv" blobs_lr: 1 - blobs_lr: 2 + blobs_lr: 1 weight_decay: 1 weight_decay: 0 convolution_param { @@ -429,11 +429,11 @@ layers { kernel_size: 1 weight_filler { type: "gaussian" - std: 0.005 + std: 0.01 } bias_filler { type: "constant" - value: 1.0 + value: 0.0 } } } diff --git a/src/caffe/layers/dropout_fixed_layer.cpp b/src/caffe/layers/dropout_fixed_layer.cpp index 405a9813976..dca05197f4a 100644 --- a/src/caffe/layers/dropout_fixed_layer.cpp +++ b/src/caffe/layers/dropout_fixed_layer.cpp @@ -17,7 +17,8 @@ void DropoutFixedLayer::LayerSetUp(const vector*>& bottom, threshold_ = this->layer_param_.dropout_param().dropout_ratio(); DCHECK(threshold_ > 0.); DCHECK(threshold_ < 1.); - scale_ = 1. / (1. - threshold_); + //scale_ = 1. / (1. - threshold_); + scale_ = 1.; uint_thres_ = static_cast(UINT_MAX * threshold_); }