Skip to content

Instantly share code, notes, and snippets.

@abhishek-shrm
Created September 23, 2020 02:46
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 abhishek-shrm/583ea2fe8899a750b43e1b29eadc2869 to your computer and use it in GitHub Desktop.
Save abhishek-shrm/583ea2fe8899a750b43e1b29eadc2869 to your computer and use it in GitHub Desktop.
# Compile Model
model.compile(optimizer='adam',loss='binary_crossentropy',metrics=["accuracy"])
# Callbacks
es=EarlyStopping(monitor='val_loss', mode='min', verbose=1,patience=5,min_delta=1e-5)
mc = ModelCheckpoint("/kaggle/working/model.hdf5", monitor='val_loss', verbose=0,
save_best_only=True, mode='min')
# Training the model
model.fit(x_train_split,y_train_split, batch_size=512, epochs=100, verbose=1,
validation_data=(x_valid_split,y_valid_split), callbacks=[es,mc])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment