Skip to content

Instantly share code, notes, and snippets.

@Tony607
Created February 23, 2018 09:39
Show Gist options
  • Save Tony607/211a5d279217d91d295127659a9c9edd to your computer and use it in GitHub Desktop.
Save Tony607/211a5d279217d91d295127659a9c9edd to your computer and use it in GitHub Desktop.
source: How to generate realistic yelp restaurant reviews with Keras | DLology
# this saves the weights everytime they improve so you can let it train. Also learning rate decay
filepath="Feb-22-all-{epoch:02d}-{loss:.4f}.hdf5"
checkpoint = ModelCheckpoint(filepath, monitor='loss', verbose=1, save_best_only=True, mode='min')
reduce_lr = ReduceLROnPlateau(monitor='loss', factor=0.5,
patience=1, min_lr=0.00001)
callbacks_list = [checkpoint, reduce_lr]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment