21 lines
No EOL
736 B
Python
21 lines
No EOL
736 B
Python
model_VGG_fcm = km.Sequential()
|
|
model_VGG_fcm.add(kl.Flatten(input_shape=features_train.shape[1:]))
|
|
model_VGG_fcm.add(kl.Dense(64, activation='relu'))
|
|
model_VGG_fcm.add(kl.Dropout(0.5))
|
|
model_VGG_fcm.add(kl.Dense(1, activation='sigmoid'))
|
|
|
|
model_VGG_fcm.compile(optimizer='rmsprop',
|
|
loss='binary_crossentropy',
|
|
metrics=['accuracy'])
|
|
|
|
model_VGG_fcm.summary()
|
|
|
|
|
|
train_labels = np.array([0] * int((N_train/2)) + [1] * int((N_train/2)))
|
|
validation_labels = np.array([0] * int((N_val/2)) + [1] * int((N_val/2)))
|
|
|
|
model_VGG_fcm.fit(features_train, train_labels,
|
|
epochs=epochs,
|
|
batch_size=batch_size,
|
|
validation_data=(features_validation, validation_labels))
|
|
t_learning_VGG_fcm = te-ts |