Skip to content

Instantly share code, notes, and snippets.

@chrisumbel
Created January 16, 2025 23:21
Show Gist options
  • Select an option

  • Save chrisumbel/7debdc05b7a898ac101406ccffeb9519 to your computer and use it in GitHub Desktop.

Select an option

Save chrisumbel/7debdc05b7a898ac101406ccffeb9519 to your computer and use it in GitHub Desktop.
model = Sequential([
# feature scaling
layers.Rescaling(1./255, input_shape=(img_height, img_width, 3)),
# feature extraction
layers.Conv2D(160, kernel_size = 7, padding = 'valid', strides = (2, 2), activation = 'relu', input_shape = (img_height, img_width, 3)),
layers.MaxPooling2D(pool_size = (3, 3)),
layers.Conv2D(240, kernel_size = 5, padding = 'valid', strides = (1, 1), activation = 'relu'),
layers.MaxPooling2D(),
layers.Conv2D(320, kernel_size = 3, padding = 'valid', strides = (1, 1), activation = 'relu'),
layers.MaxPooling2D(),
layers.Conv2D(480, kernel_size = 3, padding = 'valid', strides = (1, 1), activation = 'relu'),
layers.MaxPooling2D(),
# classification
layers.Flatten(),
layers.Dense(128, activation='relu'),
layers.Dense(num_classes)
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment