Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Compile the model
batch_size = 86
opt_rms = keras.optimizers.RMSprop(lr=0.0001, rho=0.9, epsilon=1e-08, decay=0.0)
# opt_rms = keras.optimizers.Adam(lr=0.001, decay=1e-6)
model.compile(loss='categorical_crossentropy',
optimizer=opt_rms,
metrics=['accuracy'])
from time import time
epochs = 50
tbCallBack = keras.callbacks.TensorBoard(log_dir='./Graph/{}'.format(time()),
histogram_freq=0,
write_graph=True,
write_images=True)
checkpoint = ModelCheckpoint('model-{epoch:03d}.h5',
verbose=1,
monitor='val_acc',
save_best_only=True,
mode='auto')
learning_rate_reduction = ReduceLROnPlateau(monitor='val_acc',
patience=3,
verbose=1,
factor=0.5,
min_lr=0.00001)
model.fit(x_train,
y_train,
batch_size=batch_size,
epochs=epochs,
verbose=1,
validation_data=(x_test, y_test),
callbacks=[tbCallBack, checkpoint])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.