Created
November 10, 2019 10:24
-
-
Save mayurmorin/0192afb02dc343fe0d87dc014bcbd0b6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from keras.layers import Embedding, LSTM, Dense, Dropout, Lambda, Flatten | |
| from keras.models import Sequential, load_model, model_from_config | |
| import keras.backend as K | |
| def get_model(): | |
| """Define the model.""" | |
| model = Sequential() | |
| model.add(LSTM(300, dropout=0.4, recurrent_dropout=0.4, input_shape=[1, 300], return_sequences=True)) | |
| model.add(LSTM(64, recurrent_dropout=0.4)) | |
| model.add(Dropout(0.5)) | |
| model.add(Dense(1, activation='relu')) | |
| model.compile(loss='mean_squared_error', optimizer='rmsprop', metrics=['mae']) | |
| model.summary() | |
| return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment