Created
February 5, 2021 12:05
-
-
Save AyishaR/3564c0c70cf1e4bd8d6d8e2a7533da0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model = models.Sequential([ | |
layers.Dense(32, activation = 'relu', input_shape = Xtrain[0].shape), | |
layers.Dropout(0.2), | |
layers.Dense(16, activation = 'relu'), | |
layers.Dense(1, activation = 'sigmoid') | |
]) | |
cb = callbacks.EarlyStopping(patience = 5, restore_best_weights = True) | |
model.compile(optimizer = optimizers.Adam(0.01), loss = losses.BinaryCrossentropy(), metrics = ['accuracy']) | |
history = model.fit(Xtrain, ytrain, validation_data = (Xval, yval), epochs = 256, callbacks = cb) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment