Skip to content

Instantly share code, notes, and snippets.

@ResidentMario
Last active March 30, 2019 00:16
Show Gist options
  • Select an option

  • Save ResidentMario/5b6ab845c8e42a58060058ce58baa5f9 to your computer and use it in GitHub Desktop.

Select an option

Save ResidentMario/5b6ab845c8e42a58060058ce58baa5f9 to your computer and use it in GitHub Desktop.
prior = keras.applications.VGG16(
include_top=False,
weights='imagenet',
input_shape=(48, 48, 3)
)
model = Sequential()
model.add(prior)
model.add(Flatten())
model.add(Dense(256, activation='relu', name='Dense_Intermediate'))
model.add(Dropout(0.1, name='Dropout_Regularization'))
model.add(Dense(12, activation='sigmoid', name='Output'))
for cnn_block_layer in model.layers[0].layers:
cnn_block_layer.trainable = False
model.layers[0].trainable = False
model.compile(
optimizer=RMSprop(),
loss='categorical_crossentropy',
metrics=['accuracy']
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment