Created
February 7, 2024 10:11
-
-
Save Tob-iee/05ef1d33ec98b45fff8862699a7a5216 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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