Last active
August 16, 2020 16:12
-
-
Save shayaf84/02b820494e50d1708219751a09ad482f 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
model = Sequential() | |
model.add(Reshape((64,64,3))) | |
model.add(Conv2D(32, (3, 3), padding = 'same', \ | |
activation="relu",input_shape = (2000,64,64,3))) | |
model.add(MaxPooling2D(pool_size=(2, 2))) | |
model.add(Dropout(0.5)) | |
model.add(Conv2D(32, (3, 3), padding = 'same',activation="relu")) | |
model.add(MaxPooling2D(pool_size=(2, 2))) | |
model.add(Flatten()) | |
model.add(Dropout(0.5)) | |
model.add(Dense(32, activation = 'relu')) | |
model.add(Dropout(0.5)) | |
model.add(Dense(1, activation = 'sigmoid')) | |
opt = keras.optimizers.rmsprop(lr=1e-4, decay=1e-6) | |
model.compile(loss="binary_crossentropy",optimizer=opt,metrics=['accuracy']) | |
monitor = ModelCheckpoint('./model.h5', monitor='val_acc', verbose=0,\ | |
save_best_only=True, save_weights_only=False,\ | |
mode='auto', period=1) | |
history = model.fit(train_data, train_labels, epochs = 15,\ | |
validation_data = (test_data, test_labels),callbacks=[monitor]) | |
plot_acc(history) | |
plot_loss(history) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment