Skip to content

Instantly share code, notes, and snippets.

@Tob-iee
Created February 7, 2024 10:11
Show Gist options
  • Save Tob-iee/05ef1d33ec98b45fff8862699a7a5216 to your computer and use it in GitHub Desktop.
Save Tob-iee/05ef1d33ec98b45fff8862699a7a5216 to your computer and use it in GitHub Desktop.
# create a model
def create_model():
METRICS = [
'accuracy',
tf.keras.metrics.Precision(name='precision'),
tf.keras.metrics.Recall(name='recall'),
tf.keras.metrics.AUC(name='AUC'),
]
model = Sequential([Conv2D(16, (3,3), input_shape=(IMG_SIZE[0], IMG_SIZE[1], 3), activation="relu"),
BatchNormalization(),
MaxPooling2D(2,2),
Dropout(0.3),
Flatten(),
Dense(64, activation="relu"),
Dense(4, activation="softmax"),
])
model.compile(optimizer="adamax", loss="categorical_crossentropy", metrics=METRICS)
return model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment