Skip to content

Instantly share code, notes, and snippets.

@SmiffyKMc
Created June 17, 2022 15:06
Show Gist options
  • Save SmiffyKMc/5cf754d49eaba647ac8e886d79d790ef to your computer and use it in GitHub Desktop.
Save SmiffyKMc/5cf754d49eaba647ac8e886d79d790ef to your computer and use it in GitHub Desktop.
V3 of the model
inputs = keras.Input(shape=(8, 8, 512))
x = layers.Flatten()(inputs)
x = layers.Dense(256)(x)
x = layers.Dropout(0.5)(x)
outputs = layers.Dense(1, activation= keras.activations.sigmoid)(x)
model = keras.Model(inputs, outputs)
model.compile(optimizer=keras.optimizers.RMSprop(),
loss=keras.losses.BinaryCrossentropy(),
metrics=["accuracy"])
callbacks = [
keras.callbacks.ModelCheckpoint(
filepath=f"{hotDogDir}hotdog_classifier_v3.keras",
save_best_only=True,
monitor="val_loss"
)
]
history = model.fit(
train_features,
train_labels,
epochs=20,
validation_data=(val_features, val_labels),
callbacks=callbacks
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment