Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Austriker committed May 19, 2016
1 parent 4dc222b commit 7d425cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/caffe/test/test_roi_pooling_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,13 @@ class ROIPoolingLayerTest : public GPUDeviceTest<Dtype> {
TYPED_TEST_CASE(ROIPoolingLayerTest, TestDtypes);

TYPED_TEST(ROIPoolingLayerTest, TestGradient) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
ROIPoolingParameter* roi_pooling_param =
layer_param.mutable_roi_pooling_param();
roi_pooling_param->set_pooled_h(6);
roi_pooling_param->set_pooled_w(6);
ROIPoolingLayer<Dtype> layer(layer_param);
GradientChecker<Dtype> checker(1e-4, 1e-2);
ROIPoolingLayer<TypeParam> layer(layer_param);
GradientChecker<TypeParam> checker(1e-4, 1e-2);
checker.CheckGradientExhaustive(&layer, this->blob_bottom_vec_,
this->blob_top_vec_, 0);
}
Expand Down
7 changes: 3 additions & 4 deletions src/caffe/test/test_smooth_l1_loss_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,16 @@ class SmoothL1LossLayerTest : public GPUDeviceTest<Dtype> {
TYPED_TEST_CASE(SmoothL1LossLayerTest, TestDtypes);

TYPED_TEST(SmoothL1LossLayerTest, TestGradient) {
typedef typename TypeParam::Dtype Dtype;
LayerParameter layer_param;
SmoothL1LossParameter* loss_param =
layer_param.mutable_smooth_l1_loss_param();
loss_param->set_sigma(2.4);

const Dtype kLossWeight = 3.7;
const TypeParam kLossWeight = 3.7;
layer_param.add_loss_weight(kLossWeight);
SmoothL1LossLayer<Dtype> layer(layer_param);
SmoothL1LossLayer<TypeParam> layer(layer_param);
layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_);
GradientChecker<Dtype> checker(1e-2, 1e-2, 1701);
GradientChecker<TypeParam> checker(1e-2, 1e-2, 1701);
checker.CheckGradientExhaustive(&layer, this->blob_bottom_vec_,
this->blob_top_vec_, 0);
checker.CheckGradientExhaustive(&layer, this->blob_bottom_vec_,
Expand Down

0 comments on commit 7d425cb

Please sign in to comment.