Last active
April 16, 2018 02:42
-
-
Save hanneshapke/39af6a4d4c6a389ebbe5e6f3e29d5496 to your computer and use it in GitHub Desktop.
Model definition for the CNN Visualization Demo
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
sequence_input = Input(shape=(maxlen_text,)) | |
x = Embedding(name='embedding_layer', | |
input_dim=max_words_to_keep, | |
output_dim=token_vec_size, | |
input_length=maxlen_text)(sequence_input) | |
x = Dropout(.20)(x) | |
x = Conv1D(64, 5, activation='relu', name='1-conv1d', padding='same')(x) | |
x = MaxPooling1D(pool_size=4)(x) | |
x = Dropout(.20)(x) | |
x = Conv1D(64, 5, activation='relu', name='2-conv1d', padding='same')(x) | |
x = MaxPooling1D(pool_size=2)(x) | |
x = Dropout(.20)(x) | |
x = Flatten()(x) | |
output = Dense(units=output_dim,activation='softmax')(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment