LSTM model with parameters

I'm trying to make a LSTM model in Keras with the following parameters:

enter image description here

However, I'm not sure my code is right.

model = Sequential()

model.add(LSTM(16, activation='relu', input_shape=(3, 1))) #16 neurons (?)

model.add(LSTM(32))

model.add(LSTM(64))

model.add(Dense(units =128))

model.compile(optimizer='adam', loss='mse')

1 answer

  • answered 2022-02-01 07:04 TFer

    As per the your requirement below code can be used

    model = Sequential()
    
    model.add(LSTM(16, return_sequences=True, activation='relu', input_shape=(3, 1))) #16 neurons (?)
    
    model.add(LSTM(32, return_sequences=True))
    
    model.add(LSTM(64))
    
    model.add(Dense(units =128))
    
    model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=0.001), loss='mse')
    
    model.fit(x_train, epochs=300, batch_size=10)
    

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum