text_plain_output_2.png text_plain_output_1.png
from tensorflow import keras

y_train = keras.utils.to_categorical(y_train)
y_val = keras.utils.to_categorical(y_val)

model = keras.models.Sequential([keras.layers.Conv2D(32, kernel_size=3, activation='relu', input_shape=(28, 28, 1)), keras.layers.BatchNormalization(), keras.layers.Conv2D(32, kernel_size=3, activation='relu'), keras.layers.BatchNormalization(), keras.layers.Conv2D(32, kernel_size=5, strides=2, padding='same', activation='relu'), keras.layers.BatchNormalization(), keras.layers.Dropout(rate=0.4), keras.layers.Conv2D(64, kernel_size=3, activation='relu'), keras.layers.BatchNormalization(), keras.layers.Conv2D(64, kernel_size=3, activation='relu'), keras.layers.BatchNormalization(), keras.layers.Conv2D(64, kernel_size=5, strides=2, padding='same', activation='relu'), keras.layers.BatchNormalization(), keras.layers.Dropout(rate=0.4), keras.layers.Flatten(), keras.layers.Dense(128, activation='relu'), keras.layers.BatchNormalization(), keras.layers.Dropout(rate=0.4), keras.layers.Dense(10, activation='softmax')])

model.summary()