Created
January 1, 2018 06:52
-
-
Save khuangaf/dd82d147ec1c66ae61cd9aa6b3d76718 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
def fit_lstm(reg): | |
global training_datas, training_labels, batch_size, epochs,step_size,nb_features, units | |
model = Sequential() | |
model.add(CuDNNLSTM(units=units, bias_regularizer=reg, input_shape=(step_size,nb_features),return_sequences=False)) | |
model.add(Activation('tanh')) | |
model.add(Dropout(0.2)) | |
model.add(Dense(output_size)) | |
model.add(LeakyReLU()) | |
model.compile(loss='mse', optimizer='adam') | |
model.fit(training_datas, training_labels, batch_size=batch_size, epochs = epochs, verbose=0) | |
return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment