Skip to content

Instantly share code, notes, and snippets.

@Kakarot-2000
Last active July 25, 2021 11:12
Show Gist options
  • Save Kakarot-2000/ee0c107f1b0a13c0e5eab7c7c7c6bd20 to your computer and use it in GitHub Desktop.
Save Kakarot-2000/ee0c107f1b0a13c0e5eab7c7c7c6bd20 to your computer and use it in GitHub Desktop.
x_train=x_train.astype('float32')
x_test=x_test.astype('float32')
#intializing callbacks
early_stopping=keras.callbacks.EarlyStopping(patience=15,restore_best_weights=True)
model1.compile(optimizer='Adam',loss='categorical_crossentropy',metrics=['accuracy'])
model1.fit(x_train,y_train,
batch_size=64,
epochs=50,
validation_data=(x_test,y_test),
verbose=1,callbacks=[early_stopping])
print(model1.evaluate(x_test,y_test))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment