Skip to content

Instantly share code, notes, and snippets.

@quantra-go-algo
Created July 19, 2023 07:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quantra-go-algo/1ae22ef73017db3d9d9b80369175fa89 to your computer and use it in GitHub Desktop.
Save quantra-go-algo/1ae22ef73017db3d9d9b80369175fa89 to your computer and use it in GitHub Desktop.
# Define the CNN model
model = tf.keras.models.Sequential([
tf.keras.layers.Conv2D(32, (3, 3), activation='relu', input_shape=(image_width, image_height, channels)),
tf.keras.layers.MaxPooling2D((2, 2)),
tf.keras.layers.Conv2D(64, (3, 3), activation='relu'),
tf.keras.layers.MaxPooling2D((2, 2)),
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(num_classes, activation='softmax')
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment