def __call__(self, x): if self.up: h = F.unpooling_1d(x, 2, 2, 0, cover_all=False) h = glu(self.bn0(self.cup(h))) if self.down: h = glu(self.bn0(self.cdown(x))) else: h = glu(self.bn0(self.cpara(x))) return h
def test_unpooling_1d_invalid(self): (x, ksize) = self._get_data(2) with self.assertRaises(ValueError): functions.unpooling_1d(x, ksize)
def test_unpooling_1d(self): (x, ksize) = self._get_data(1) testing.assert_allclose( functions.unpooling_nd(x, ksize).data, functions.unpooling_1d(x, ksize).data)