Caffe::set_mode(Caffe::CPU);
const bool unique_pixels = false; // all pixels the same; images different
this->FillLevelDB(unique_pixels);
+ const TypeParam scale = 3;
LayerParameter param;
DataParameter* data_param = param.mutable_data_param();
data_param->set_batch_size(5);
+ data_param->set_scale(scale);
data_param->set_source(this->filename_->c_str());
DataLayer<TypeParam> layer(param);
layer.SetUp(this->blob_bottom_vec_, &this->blob_top_vec_);
}
for (int i = 0; i < 5; ++i) {
for (int j = 0; j < 24; ++j) {
- EXPECT_EQ(i, this->blob_top_data_->cpu_data()[i * 24 + j])
- << "debug: i " << i << " j " << j;
+ EXPECT_EQ(scale * i, this->blob_top_data_->cpu_data()[i * 24 + j])
+ << "debug: iter " << iter << " i " << i << " j " << j;
}
}
}
Caffe::set_mode(Caffe::GPU);
const bool unique_pixels = false; // all pixels the same; images different
this->FillLevelDB(unique_pixels);
+ const TypeParam scale = 3;
LayerParameter param;
DataParameter* data_param = param.mutable_data_param();
data_param->set_batch_size(5);
+ data_param->set_scale(scale);
data_param->set_source(this->filename_->c_str());
DataLayer<TypeParam> layer(param);
layer.SetUp(this->blob_bottom_vec_, &this->blob_top_vec_);
}
for (int i = 0; i < 5; ++i) {
for (int j = 0; j < 24; ++j) {
- EXPECT_EQ(i, this->blob_top_data_->cpu_data()[i * 24 + j])
- << "debug: i " << i << " j " << j;
+ EXPECT_EQ(scale * i, this->blob_top_data_->cpu_data()[i * 24 + j])
+ << "debug: iter " << iter << " i " << i << " j " << j;
}
}
}
Caffe::set_mode(Caffe::CPU);
const bool unique_pixels = true; // all images the same; pixels different
this->FillLevelDB(unique_pixels);
+ const TypeParam scale = 3;
LayerParameter param;
DataParameter* data_param = param.mutable_data_param();
data_param->set_batch_size(5);
+ data_param->set_scale(scale);
data_param->set_crop_size(1);
data_param->set_source(this->filename_->c_str());
DataLayer<TypeParam> layer(param);
int num_with_center_value = 0;
for (int i = 0; i < 5; ++i) {
for (int j = 0; j < 2; ++j) {
- const TypeParam center_value = j ? 17 : 5;
+ const TypeParam center_value = scale * (j ? 17 : 5);
num_with_center_value +=
(center_value == this->blob_top_data_->cpu_data()[i * 2 + j]);
}
Caffe::set_mode(Caffe::GPU);
const bool unique_pixels = true; // all images the same; pixels different
this->FillLevelDB(unique_pixels);
+ const TypeParam scale = 3;
LayerParameter param;
DataParameter* data_param = param.mutable_data_param();
data_param->set_batch_size(5);
+ data_param->set_scale(scale);
data_param->set_crop_size(1);
data_param->set_source(this->filename_->c_str());
DataLayer<TypeParam> layer(param);
int num_with_center_value = 0;
for (int i = 0; i < 5; ++i) {
for (int j = 0; j < 2; ++j) {
- const TypeParam center_value = j ? 17 : 5;
+ const TypeParam center_value = scale * (j ? 17 : 5);
num_with_center_value +=
(center_value == this->blob_top_data_->cpu_data()[i * 2 + j]);
}
Caffe::set_mode(Caffe::CPU);
const bool unique_pixels = true; // all images the same; pixels different
this->FillLevelDB(unique_pixels);
+ const TypeParam scale = 3;
LayerParameter param;
DataParameter* data_param = param.mutable_data_param();
data_param->set_batch_size(5);
+ data_param->set_scale(scale);
data_param->set_crop_size(1);
data_param->set_source(this->filename_->c_str());
DataLayer<TypeParam> layer(param);
}
for (int i = 0; i < 5; ++i) {
for (int j = 0; j < 2; ++j) {
- const TypeParam center_value = j ? 17 : 5;
+ const TypeParam center_value = scale * (j ? 17 : 5);
EXPECT_EQ(center_value, this->blob_top_data_->cpu_data()[i * 2 + j])
- << "debug: i " << i << " j " << j;
+ << "debug: iter " << iter << " i " << i << " j " << j;
}
}
}
Caffe::set_mode(Caffe::GPU);
const bool unique_pixels = true; // all images the same; pixels different
this->FillLevelDB(unique_pixels);
+ const TypeParam scale = 3;
LayerParameter param;
DataParameter* data_param = param.mutable_data_param();
data_param->set_batch_size(5);
+ data_param->set_scale(scale);
data_param->set_crop_size(1);
data_param->set_source(this->filename_->c_str());
DataLayer<TypeParam> layer(param);
}
for (int i = 0; i < 5; ++i) {
for (int j = 0; j < 2; ++j) {
- const TypeParam center_value = j ? 17 : 5;
+ const TypeParam center_value = scale * (j ? 17 : 5);
EXPECT_EQ(center_value, this->blob_top_data_->cpu_data()[i * 2 + j])
- << "debug: i " << i << " j " << j;
+ << "debug: iter " << iter << " i " << i << " j " << j;
}
}
}