Created
November 18, 2017 07:39
-
-
Save drorhilman/899da9e80427301bdaabce8fbd542fce to your computer and use it in GitHub Desktop.
This file contains hidden or 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.layers import Dense, Dropout, Input, BatchNormalization | |
from keras.models import Model | |
def get_nn_model(dropout=0.6): | |
inp = Input(shape = (90,)) | |
x = Dense(100, activation='relu')(inp) | |
x = BatchNormalization()(x) | |
x = Dropout(dropout)(x) | |
x = Dense(50, activation='relu')(x) | |
x = BatchNormalization()(x) | |
x = Dropout(dropout)(x) | |
x = Dense(50, activation='relu')(x) | |
x = BatchNormalization()(x) | |
x = Dropout(dropout)(x) | |
x = Dense(1, activation='sigmoid')(x) | |
model = Model(inputs=[inp], outputs=[x]) | |
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy']) | |
return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment