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