コード例 #1
0
ファイル: model.py プロジェクト: Chow549/VoiceConversion
    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
コード例 #2
0
ファイル: test_unpooling_nd.py プロジェクト: asi1024/chainer
 def test_unpooling_1d_invalid(self):
     (x, ksize) = self._get_data(2)
     with self.assertRaises(ValueError):
         functions.unpooling_1d(x, ksize)
コード例 #3
0
ファイル: test_unpooling_nd.py プロジェクト: asi1024/chainer
 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)
コード例 #4
0
 def test_unpooling_1d_invalid(self):
     (x, ksize) = self._get_data(2)
     with self.assertRaises(ValueError):
         functions.unpooling_1d(x, ksize)
コード例 #5
0
 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)