from keras.layers import Dropout
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import LSTM
from tensorflow.keras.metrics import RootMeanSquaredError, MeanAbsoluteError
from tensorflow.keras.models import Sequential


def get_model(params, input_shape):
    model = Sequential()
    model.add(LSTM(units=params["lstm_units"], return_sequences=True, input_shape=(input_shape, 1)))
    model.add(Dropout(rate=params["dropout"]))

    model.add(LSTM(units=params["lstm_units"], return_sequences=True))
    model.add(Dropout(rate=params["dropout"]))

    model.add(LSTM(units=params["lstm_units"], return_sequences=True))
    model.add(Dropout(rate=params["dropout"]))

    model.add(LSTM(units=params["lstm_units"], return_sequences=False))
    model.add(Dropout(rate=params["dropout"]))

    model.add(Dense(1))

    model.compile(loss=params["loss"],
                  optimizer=params["optimizer"],
                  metrics=[RootMeanSquaredError(), MeanAbsoluteError()])

    return model

tensorflow.keras.layers.Dense tensorflow.keras.layers.LSTM tensorflow.keras.metrics.MeanAbsoluteError tensorflow.keras.metrics.RootMeanSquaredError tensorflow.keras.models.Sequential
[(9, 'tensorflow.keras.models.Sequential', 'Sequential', ([], {}), False, 'from tensorflow.keras.models import Sequential\n'), (10, 'tensorflow.keras.layers.LSTM', 'LSTM', ([], {'units': "params['lstm_units']", 'return_sequences': '(True)', 'input_shape': '(input_shape, 1)'}), False, 'from tensorflow.keras.layers import LSTM\n'), (11, 'keras.layers.Dropout', 'Dropout', ([], {'rate': "params['dropout']"}), False, 'from keras.layers import Dropout\n'), (13, 'tensorflow.keras.layers.LSTM', 'LSTM', ([], {'units': "params['lstm_units']", 'return_sequences': '(True)'}), False, 'from tensorflow.keras.layers import LSTM\n'), (14, 'keras.layers.Dropout', 'Dropout', ([], {'rate': "params['dropout']"}), False, 'from keras.layers import Dropout\n'), (16, 'tensorflow.keras.layers.LSTM', 'LSTM', ([], {'units': "params['lstm_units']", 'return_sequences': '(True)'}), False, 'from tensorflow.keras.layers import LSTM\n'), (17, 'keras.layers.Dropout', 'Dropout', ([], {'rate': "params['dropout']"}), False, 'from keras.layers import Dropout\n'), (19, 'tensorflow.keras.layers.LSTM', 'LSTM', ([], {'units': "params['lstm_units']", 'return_sequences': '(False)'}), False, 'from tensorflow.keras.layers import LSTM\n'), (20, 'keras.layers.Dropout', 'Dropout', ([], {'rate': "params['dropout']"}), False, 'from keras.layers import Dropout\n'), (22, 'tensorflow.keras.layers.Dense', 'Dense', (['(1)'], {}), False, 'from tensorflow.keras.layers import Dense\n'), (26, 'tensorflow.keras.metrics.RootMeanSquaredError', 'RootMeanSquaredError', ([], {}), False, 'from tensorflow.keras.metrics import RootMeanSquaredError, MeanAbsoluteError\n'), (26, 'tensorflow.keras.metrics.MeanAbsoluteError', 'MeanAbsoluteError', ([], {}), False, 'from tensorflow.keras.metrics import RootMeanSquaredError, MeanAbsoluteError\n')]