Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Importing from keras
from keras.models import Model
from keras.layers import Input, Dense, Embedding, Dropout, Conv1D, GlobalMaxPooling1D
from keras.callbacks import EarlyStopping, ModelCheckpoint
# Defining model architecture
input_1=Input(shape=(100,))
embedding_1=Embedding(vocabulary,100)(input_1)
conv_1=Conv1D(filters=352,kernel_size=7,padding="same")(embedding_1)
dropout_1=Dropout(0.06675)(conv_1)
pool_1=GlobalMaxPooling1D()(dropout_1)
# Adding Fully-connected layer and output layer
dense=Dense(128,activation='relu')(pool_1)
output=Dense(6,activation='sigmoid')(dense)
model=Model(inputs=[input_1],outputs=output)
# Printing model summary
model.summary()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment