<jupyter_start><jupyter_text>Exercise 3.3 - Building a convolutional neural network model with Keras high-level API Import TensorFlow module and print its version<jupyter_code>from __future__ import absolute_import, division, print_function, unicode_literals

import tensorflow as tf

print("TensorFlow version: {}".format(tf.__version__))<jupyter_output>TensorFlow version: 2.1.0<jupyter_text>Build the model using Keras `sequential` method and print network summary<jupyter_code>IMG_HEIGHT = 480
IMG_WIDTH = 680

model = tf.keras.Sequential([ 
    tf.keras.layers.Conv2D(16, 3, padding='same', activation='relu', 
                           input_shape=(IMG_HEIGHT, IMG_WIDTH ,3)), 
    tf.keras.layers.MaxPooling2D(), 
    tf.keras.layers.Conv2D(32, 3, padding='same', activation='relu'), 
    tf.keras.layers.MaxPooling2D(), 
    tf.keras.layers.Conv2D(64, 3, padding='same', activation='relu'), 
    tf.keras.layers.MaxPooling2D(), 
    tf.keras.layers.Flatten(), 
    tf.keras.layers.Dense(512, activation='relu'), 
    tf.keras.layers.Dense(1) 
]) 

model.summary()<jupyter_output>Model: "sequential"
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
conv2d (Conv2D)              (None, 480, 680, 16)      448       
_________________________________________________________________
max_pooling2d (MaxPooling2D) (None, 240, 340, 16)      0         
_________________________________________________________________
conv2d_1 (Conv2D)            (None, 240, 340, 32)      4640      
_________________________________________________________________
max_pooling2d_1 (MaxPooling2 (None, 120, 170, 32)      0         
_________________________________________________________________
conv2d_2 (Conv2D)            (None, 120, 170, 64)      18496     
_________________________________________________________________
max_pooling2d_2 (MaxPooling2 (None, 60, 85, 64)        0         
________________________________________________________[...]
{'fraction_non_alphanumeric': 0.12135690396559962, 'fraction_numerical': 0.051600573339703776, 'mean_word_length': 4.27455919395466, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '614008', 'license': 'MIT', 'n_tokens_mistral': 647, 'n_tokens_neox': 559, 'n_words': 120, 'path': 'Chapter03/Exercise03_03/Exercise03_03.ipynb', 'repo_name': 'adityashah95/The-Reinforcement-Learning-Workshop', 'size': '2093'}