MCPcopy Create free account
hub / github.com/BVLC/caffe / TestGradient

Method TestGradient

src/caffe/test/test_reduction_layer.cpp:80–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 }
79
80 void TestGradient(ReductionParameter_ReductionOp op,
81 float coeff = 1, int axis = 0) {
82 typedef typename TypeParam::Dtype Dtype;
83 LayerParameter layer_param;
84 ReductionParameter* reduction_param = layer_param.mutable_reduction_param();
85 reduction_param->set_operation(op);
86 reduction_param->set_coeff(coeff);
87 reduction_param->set_axis(axis);
88 ReductionLayer<Dtype> layer(layer_param);
89 GradientChecker<Dtype> checker(1e-2, 2e-3);
90 checker.CheckGradientExhaustive(&layer, this->blob_bottom_vec_,
91 this->blob_top_vec_);
92 }
93
94 Blob<Dtype>* const blob_bottom_;
95 Blob<Dtype>* const blob_top_;

Callers 1

TYPED_TESTFunction · 0.80

Calls 1

Tested by

no test coverage detected