Created
June 24, 2019 06:23
-
-
Save ayushoriginal/d667c0910de5a72054cc4cfd16fc628b to your computer and use it in GitHub Desktop.
LSTM
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
def LSTM(self): | |
model = Sequential() | |
model.add(Embedding(self.vocab_length, 30, input_length=self.max_len)) | |
model.add(LSTM(200)) | |
model.add(Dense(self.max_len, activation='relu', W_regularizer=l2(0.90))) | |
model.add(Dense(self.tr_labels.shape[1], activation='softmax', W_regularizer=l2(0.1))) | |
adam_1 = Adam(lr=0.008) | |
model.compile(loss='categorical_crossentropy', optimizer=adam_1,metrics=['accuracy']) | |
model.summary() | |
self.model = model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment