Skip to content

Commit a8da42f

Browse files
Merge pull request MichalDanielDobrzanski#2 from pa-m/master
Avoid ImportError: cannot import name 'downsample'. New naming convention has been added in Theano 0.9 => use pool_2d instead
2 parents f48defe + 2a26d29 commit a8da42f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

network3.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from theano.tensor.nnet import conv
4040
from theano.tensor.nnet import softmax
4141
from theano.tensor import shared_randomstreams
42-
from theano.tensor.signal import downsample
42+
from theano.tensor.signal.pool import pool_2d
4343

4444
# Activation functions for neurons
4545
def linear(z): return z
@@ -227,8 +227,8 @@ def set_inpt(self, inpt, inpt_dropout, mini_batch_size):
227227
conv_out = conv.conv2d(
228228
input=self.inpt, filters=self.w, filter_shape=self.filter_shape,
229229
image_shape=self.image_shape)
230-
pooled_out = downsample.max_pool_2d(
231-
input=conv_out, ds=self.poolsize, ignore_border=True)
230+
pooled_out = pool_2d(
231+
input=conv_out, ws=self.poolsize, ignore_border=True)
232232
self.output = self.activation_fn(
233233
pooled_out + self.b.dimshuffle('x', 0, 'x', 'x'))
234234
self.output_dropout = self.output # no dropout in the convolutional layers

0 commit comments

Comments
 (0)