Skip to Content
Mastering Computer Vision with TensorFlow 2.x
book

Mastering Computer Vision with TensorFlow 2.x

by Krishnendu Kar
May 2020
Beginner to intermediate
430 pages
10h 39m
English
Packt Publishing
Content preview from Mastering Computer Vision with TensorFlow 2.x

Iteration 4 – CNN parameter adjustment

In this iteration, all the parameters are the same as they were in the previous iteration, except for strides = 2, which is added after the first Conv2D.

Next, we keep everything the same but add a pooling layer after the first Conv2D:

model.add(Conv2D(64, (3, 3), activation='relu', input_shape=(48,48,1)))model.add(AveragePooling2D(pool_size=(3,3), strides=(2, 2)))model.add(Conv2D(128, (3, 3), activation='relu'))model.add(AveragePooling2D(pool_size=(3,3), strides=(2, 2)))

In this iteration, no change is made to the dense layer. The calculation time is faster but the accuracy has dropped:

Epoch 1/5 256/256 [========================] - 99s 386ms/step - loss: 1.6855 - acc: 0.3240 Epoch 2/5 256/256 [========================] ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Computer Vision with TensorFlow 2

Hands-On Computer Vision with TensorFlow 2

Benjamin Planche, Eliot Andres

Publisher Resources

ISBN: 9781838827069Supplemental Content