Advertisement
sreejith2904

TS Model

Dec 10th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.94 KB | None | 0 0
  1. prediction_days=1
  2. model = Sequential()
  3. model.add(LSTM(100, input_shape=(train_X.shape[1],
  4.                                 train_X.shape[2]),
  5.                        return_sequences=True))
  6.  
  7. model.add(LSTM(100, input_shape=(train_X.shape[1],
  8.                                      train_X.shape[2])))
  9. model.add(Dense(75,
  10.                     activation= "relu",
  11.                     input_dim = lookback*features))
  12. model.add(Dense(100,
  13.                     activation= "relu",
  14.                     input_dim = lookback*features))
  15.  
  16. model.add(Dense(prediction_days))
  17. model.compile(loss='mean_squared_error', optimizer='adam')
  18.  
  19. history = model.fit(train_X,
  20.                     train_Y,
  21.                     epochs=100,
  22.                     batch_size=21,
  23.                     validation_data=(validation_X, validation_Y),
  24.                     verbose=0,
  25.                     shuffle=False,
  26.                     callbacks=[TQDMNotebookCallback()])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement