Created
September 16, 2022 18:38
-
-
Save under0tech/b423fb2cce918c908a0320bf2a8715e9 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 GetTrainedModel(x_train, y_train): | |
model = Sequential() | |
model.add(LSTM(60, return_sequences=True, input_shape=(N_STEPS, len(['close'])))) | |
model.add(Dropout(0.3)) | |
model.add(LSTM(120, return_sequences=False)) | |
model.add(Dropout(0.3)) | |
model.add(Dense(20)) | |
model.add(Dense(1)) | |
BATCH_SIZE = 8 | |
EPOCHS = 80 | |
model.compile(loss='mean_squared_error', optimizer='adam') | |
model.fit(x_train, y_train, | |
batch_size=BATCH_SIZE, | |
epochs=EPOCHS, | |
verbose=1) | |
model.summary() | |
return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment