Skip to content

Commit 68ab63a

Browse files
Merge pull request lazyprogrammer#8 from davidvartanian/master
Updating cnn_theano code according to theano API last update.
2 parents 3ddfbdf + 5ed7698 commit 68ab63a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cnn_class/cnn_theano.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import matplotlib.pyplot as plt
88

99
from theano.tensor.nnet import conv2d
10-
from theano.tensor.signal import downsample
10+
from theano.tensor.signal import pool
1111

1212
from scipy.io import loadmat
1313
from sklearn.utils import shuffle
@@ -37,9 +37,9 @@ def convpool(X, W, b, poolsize=(2, 2)):
3737
conv_out = conv2d(input=X, filters=W)
3838

3939
# downsample each feature map individually, using maxpooling
40-
pooled_out = downsample.max_pool_2d(
40+
pooled_out = pool.pool_2d(
4141
input=conv_out,
42-
ds=poolsize,
42+
ws=poolsize,
4343
ignore_border=True
4444
)
4545

@@ -96,7 +96,7 @@ def main():
9696

9797
N = Xtrain.shape[0]
9898
batch_sz = 500
99-
n_batches = N / batch_sz
99+
n_batches = N // batch_sz
100100

101101
M = 500
102102
K = 10

0 commit comments

Comments
 (0)