예제 #1
0
 def test_direct_center(self):
     c = np.array([1, 0, 1, 0, 0, 0])
     d = np.array([1, 0, 0, 0, 1, 0])
     predict_cd = np.array([2, 0, 1, 0, 1, 0])
     np.testing.assert_allclose(convolve_direct(c, d), predict_cd)
예제 #2
0
 def test_direct_backward(self):
     d = np.array([1, 0, 0, 0, 1, 0])
     predict_dd = np.array([1, 0, 1, 0, 2, 0])
     np.testing.assert_allclose(convolve_direct(d, d), predict_dd)
예제 #3
0
 def test_direct_ID2(self):
     a = np.array([1, 0, 0, 0, 0, 0])
     c = np.array([1, 0, 1, 0, 0, 0])
     predict_ac = np.array([1, 0, 1, 0, 0, 0])
     np.testing.assert_allclose(convolve_direct(a, c), predict_ac)
예제 #4
0
 def test_direct_forward(self):
     c = np.array([1, 0, 1, 0, 0, 0])
     predict_cc = np.array([1, 0, 2, 0, 1, 0])
     np.testing.assert_allclose(convolve_direct(c, c), predict_cc)
예제 #5
0
 def test_direct_ID(self):
     a = np.array([1, 0, 0, 0, 0, 0])
     b = np.array([1, 0, 0, 0, 0, 0])
     predict_ab = np.array([1, 0, 0, 0, 0, 0])
     np.testing.assert_allclose(convolve_direct(a, b), predict_ab)