Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save saimadhu-polamuri/d709741375eba20f7b54ddd4e9143fea to your computer and use it in GitHub Desktop.
Save saimadhu-polamuri/d709741375eba20f7b54ddd4e9143fea to your computer and use it in GitHub Desktop.
## Model with Dropout
from tensorflow.keras.layers import Dropout
model = Sequential()
model.add(Dense(500, input_dim=2, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(128, activation='relu'))
model.add(Dropout(0.25))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy',
optimizer='adam',
metrics=['accuracy'])
history = model.fit(x_train, y_train,
validation_data=(x_test, y_test),
epochs=500, verbose=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment