def test_outout_with_interleave_and_stride_and_no_interleave(): in_shape = 200, 200 desc = L3_first_desc slm = SequentialLayeredModel(in_shape, desc) img = np.random.randn(200, 200).astype('f') full_features = slm.process(img, pad_apron=True, interleave_stride=True) features = slm.process(img, pad_apron=True, interleave_stride=False) assert_allclose(features, full_features[::8, ::8], rtol=RTOL, atol=ATOL)
def test_outout_with_interleave_and_stride_and_no_interleave(): in_shape = 200, 200 desc = L3_first_desc slm = SequentialLayeredModel(in_shape, desc) img = np.random.randn(200, 200).astype('f') full_features = slm.process(img, pad_apron=True, interleave_stride=True) features = slm.process(img, pad_apron=True, interleave_stride=False) assert_allclose(features, full_features[::8, ::8], rtol=RTOL, atol=ATOL)
def test_zero_input_image_with_pad_with_interleave(): in_shape = 200, 200 desc = L3_first_desc slm = SequentialLayeredModel(in_shape, desc) img = np.zeros(in_shape).astype('f') features = slm.process(img, pad_apron=True, interleave_stride=True) assert features.shape == (200, 200, 256) assert features.sum() == 0.
def test_null_image_same_size_as_receptive_field(): in_shape = 121, 121 desc = L3_first_desc slm = SequentialLayeredModel(in_shape, desc) img = np.zeros(in_shape).astype('f') features = slm.process(img) assert features.shape == (1, 1, 256) assert features.sum() == 0.
def test_null_image_same_size_as_receptive_field(): in_shape = 121, 121 desc = L3_first_desc slm = SequentialLayeredModel(in_shape, desc) img = np.zeros(in_shape).astype('f') features = slm.process(img) assert features.shape == (1, 1, 256) assert features.sum() == 0.
def test_zero_input_image_with_pad_with_interleave(): in_shape = 200, 200 desc = L3_first_desc slm = SequentialLayeredModel(in_shape, desc) img = np.zeros(in_shape).astype('f') features = slm.process(img, pad_apron=True, interleave_stride=True) assert features.shape == (200, 200, 256) assert features.sum() == 0.