Skip to content

Instantly share code, notes, and snippets.

@mohdsanadzakirizvi
Created February 6, 2020 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohdsanadzakirizvi/3163f59ca6394165807563947277e3b4 to your computer and use it in GitHub Desktop.
Save mohdsanadzakirizvi/3163f59ca6394165807563947277e3b4 to your computer and use it in GitHub Desktop.
model2 = Sequential()
model2.add(Flatten(input_shape=(7,7,512)))
model2.add(Dense(100, activation='relu'))
model2.add(Dropout(0.5))
model2.add(BatchNormalization())
model2.add(Dense(10, activation='softmax'))
# compile the model
model2.compile(optimizer='adam', metrics=['accuracy'], loss='categorical_crossentropy')
model2.summary()
# train model using features generated from VGG16 model
model2.fit(vgg_features_train, train_target, epochs=50, batch_size=128, validation_data=(vgg_features_val, val_target))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment