Exemplo n.º 1
0
 def test_high_d_pool(self):
     xval = np.random.random((10, 6, 18, 14))
     x = Val(xval)
     xpooled = AvgPool((2, 2), axis=(2, 1))(x)
     self.assertEqual(xpooled.eval().shape, (10, 3, 9, 14))
     xpooled = AvgPool((2, 3), axis=(1, 2))(x)
     self.assertEqual(xpooled.eval().shape, (10, 3, 6, 14))
     xpooled = AvgPool((2, 3), axis=(2, 1))(x)
     self.assertEqual(xpooled.eval().shape, (10, 2, 9, 14))
Exemplo n.º 2
0
 def test_high_d_pool(self):
     xval = np.random.random((10, 6, 18, 14))
     x = Val(xval)
     xpooled = AvgPool((2, 2), axis=(2, 1))(x)
     self.assertEqual(xpooled.eval().shape, (10, 3, 9, 14))
     xpooled = AvgPool((2, 3), axis=(1, 2))(x)
     self.assertEqual(xpooled.eval().shape, (10, 3, 6, 14))
     xpooled = AvgPool((2, 3), axis=(2, 1))(x)
     self.assertEqual(xpooled.eval().shape, (10, 2, 9, 14))
Exemplo n.º 3
0
 def test_normal_pool(self):
     xval = np.random.random((10, 6))
     x = Val(xval)
     xpooled = AvgPool((2, 2))(x)
     self.assertEqual(xpooled.eval().shape, (5, 3))
Exemplo n.º 4
0
 def test_normal_pool(self):
     xval = np.random.random((10, 6))
     x = Val(xval)
     xpooled = AvgPool((2, 2))(x)
     self.assertEqual(xpooled.eval().shape, (5, 3))