Created
August 13, 2018 16:32
-
-
Save SkalskiP/3b9d8313e68aef495fec2351d074d01a to your computer and use it in GitHub Desktop.
Simple KERAS neural network for binary classification
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
from keras.models import Sequential | |
from keras.layers import Dense | |
model = Sequential() | |
model.add(Dense(4, input_dim=2,activation='relu')) | |
model.add(Dense(6, activation='relu')) | |
model.add(Dense(6, activation='relu')) | |
model.add(Dense(4, activation='relu')) | |
model.add(Dense(1, activation='sigmoid')) | |
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy']) | |
model.fit(X_train, y_train, epochs=50, verbose=0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment