提交 ea04c80e authored 作者: Samira Shabanian's avatar Samira Shabanian

fixed some issues in test_pool.py

上级 9cb9c431
...@@ -10,8 +10,7 @@ import theano.tensor as tensor ...@@ -10,8 +10,7 @@ import theano.tensor as tensor
from theano.tests import unittest_tools as utt from theano.tests import unittest_tools as utt
from theano.tensor.signal.pool import (Pool, pool_2d, from theano.tensor.signal.pool import (Pool, pool_2d,
MaxPoolGrad, AveragePoolGrad, MaxPoolGrad, AveragePoolGrad,
DownsampleFactorMaxGrad, DownsampleFactorMaxGrad,
DownsampleFactorMaxGradGrad,
max_pool_2d_same_size) max_pool_2d_same_size)
from theano import function from theano import function
...@@ -194,8 +193,8 @@ class TestDownsampleFactorMax(utt.InferShapeTester): ...@@ -194,8 +193,8 @@ class TestDownsampleFactorMax(utt.InferShapeTester):
# Pool op # Pool op
maxpool_op = Pool(maxpoolshp, maxpool_op = Pool(maxpoolshp,
ignore_border=ignore_border, ignore_border=ignore_border,
mode=mode)(images) mode=mode)(images)
output_shape = Pool.out_shape(imval.shape, maxpoolshp, output_shape = Pool.out_shape(imval.shape, maxpoolshp,
ignore_border=ignore_border) ignore_border=ignore_border)
...@@ -643,7 +642,7 @@ class TestDownsampleFactorMax(utt.InferShapeTester): ...@@ -643,7 +642,7 @@ class TestDownsampleFactorMax(utt.InferShapeTester):
# The value has been manually computed from the theoretical gradient, # The value has been manually computed from the theoretical gradient,
# and confirmed by the implementation. # and confirmed by the implementation.
assert numpy.allclose(fn_hess( [1, 2]), [[0., 0.], [0., 982.7667]]) assert numpy.allclose(fn_hess([1, 2]), [[0., 0.], [0., 982.7667]])
def test_max_pool_2d_2D(self): def test_max_pool_2d_2D(self):
rng = numpy.random.RandomState(utt.fetch_seed()) rng = numpy.random.RandomState(utt.fetch_seed())
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论