Created
February 1, 2018 10:49
-
-
Save nlothian/1b5728f7d965f58065381ed219a3cbfd 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
inp = Input(shape=(maxlen,), name="text_input") # featureized text comes in here | |
x = Embedding(embedding_matrix.shape[0], embed_size, weights=[embedding_matrix], trainable=True)(inp) | |
x = Dense(some_num_here, activation="relu")(x) | |
extra_data = Input(shape=(1,), name="extra_data") # your continous features comes in here | |
combined = concatenate([x, extra_data]) | |
# maybe some ReLu + Dropout here | |
out = Dense(num_classes, activation="sigmoid")(combined) | |
model = Model(inputs=[inp, extra_data], outputs=out) | |
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment