Created
September 23, 2020 02:20
-
-
Save abhishek-shrm/aa6c7f76b22bf17100f5db2b46df9f55 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
# 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