Friday, 1 January 2021

Choosing the right deep learning model in Keras

I'm facing a real-time problem which has 4 features: Vmean, Vmedian, Vnow, VV. What I'm trying to do is:

for i in range(len(X)):
     model.fit(X[i], X[i+1])
     model.predict(X[i+1])

That is, I'm trying to predict the value of X[i+2] through X[i+1] and X[i], because one row is related with the next one and so on. This is my model:

def kerasModel():
    input_layer = keras.layers.Input(shape=(4, 1), name='input_shape')
    x = keras.layers.LSTM(100, name='lstm_0')(input_layer)
    x = keras.layers.Dropout(0.2, name='lstm_dropout')(x)
    x = keras.layers.Dense(64, name='x2')(x)
    output = keras.layers.Dense(4, activation='linear', name='x3')(x)
    model = keras.Model(inputs=input_layer, outputs=output)
    
    adam = keras.optimizers.Nadam(lr=0.005)
    model.compile(optimizer=adam, loss='mse')
    
    return model

But it is not working. It's not predicting next value as it should be doing. My question is: is there any paper or rules to make a good deep learning model based on your features? Plus, based in this problem, which could be a good model?



from Choosing the right deep learning model in Keras

No comments:

Post a Comment