application_vnd.jupyter.stderr_output_1.png
from keras.layers import Conv1D, MaxPooling1D, GlobalMaxPool1D, Dropout, concatenate

from keras.layers import Dense, Embedding, Input,GRU

from keras.models import Model

max_features = 20000
maxlen = 100

def cnn_rnn():
    embed_size = 256
    inp = Input(shape=(maxlen,))
    main = Embedding(max_features, embed_size)(inp)
    main = Dropout(0.2)(main)
    main = Conv1D(filters=32, kernel_size=2, padding='same', activation='relu')(main)
    main = MaxPooling1D(pool_size=2)(main)
    main = Conv1D(filters=32, kernel_size=2, padding='same', activation='relu')(main)
    main = MaxPooling1D(pool_size=2)(main)
    main = GRU(32)(main)
    main = Dense(16, activation='relu')(main)
    main = Dense(6, activation='sigmoid')(main)
    model = Model(inputs=inp, outputs=main)
    model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
    model.summary()
    return model

model = cnn_rnn()
model.summary()