Skip to content

Commit 0f23f43

Browse files
add nonlinearity to tf cnn
1 parent 5715e3f commit 0f23f43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cnn_class/cnn_tf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def convpool(X, W, b):
3333
conv_out = tf.nn.conv2d(X, W, strides=[1, 1, 1, 1], padding='SAME')
3434
conv_out = tf.nn.bias_add(conv_out, b)
3535
pool_out = tf.nn.max_pool(conv_out, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')
36-
return pool_out
36+
return tf.nn.relu(pool_out)
3737

3838

3939
def init_filter(shape, poolsz):
@@ -73,7 +73,7 @@ def main():
7373
Ytest_ind = y2indicator(Ytest)
7474

7575
# gradient descent params
76-
max_iter = 20
76+
max_iter = 6
7777
print_period = 10
7878
N = Xtrain.shape[0]
7979
batch_sz = 500

0 commit comments

Comments
 (0)