Skip to content

Instantly share code, notes, and snippets.

@StrikingLoo
Last active June 23, 2019 23:22
Show Gist options
  • Select an option

  • Save StrikingLoo/1038da1fbcdedabf8dc9283072fdd87f to your computer and use it in GitHub Desktop.

Select an option

Save StrikingLoo/1038da1fbcdedabf8dc9283072fdd87f to your computer and use it in GitHub Desktop.
customAdam = keras.optimizers.Adam(lr=0.0001)
model.compile(optimizer=customAdam,
# Loss function to minimize
loss="binary_crossentropy",
# List of metrics to monitor
metrics=["mean_squared_error","binary_crossentropy"])
es = keras.callbacks.EarlyStopping(monitor='loss', mode='min', verbose=1, patience = 5)
print('# Fit model on training data')
history = model.fit(X,
y,
batch_size=512,
epochs=500,
validation_split=0.1,
callbacks = [es]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment