Skip to content

Instantly share code, notes, and snippets.

@StrikingLoo
Created June 12, 2019 16:56
Show Gist options
  • Save StrikingLoo/db316100077f2d90a473830e2c31f1d7 to your computer and use it in GitHub Desktop.
Save StrikingLoo/db316100077f2d90a473830e2c31f1d7 to your computer and use it in GitHub Desktop.
customAdam = keras.optimizers.Adam(lr=0.001)
model.compile(optimizer=customAdam, # Optimizer
# Loss function to minimize
loss="mean_squared_error",
# List of metrics to monitor
metrics=["binary_crossentropy","mean_squared_error"])
print('# Fit model on training data')
history = model.fit(x_train,
labels_train,
batch_size=32,
shuffle = True, #important since we loaded cats first, dogs second.
epochs=3,
validation_data=(x_valid, labels_valid))
#Train on 4096 samples, validate on 2048 samples
#loss: 0.5000 - binary_crossentropy: 8.0590 - mean_squared_error: 0.5000 - val_loss: 0.5000 - val_binary_crossentropy: 8.0591 - val_mean_squared_error: 0.5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment