Amin Memar

Amin Memar

  • NA
  • 179
  • 27.4k

LSTM Layer accuracy is 0

May 27 2021 5:41 PM
hello everyone
i have network that gets 9 days and predict 10s day price using lstm
my x shape is (240,9,1) and y shape is (240,1,1)
the problem is accuracy is 0
can anyone help
here is my code
 
model = Sequential()
model.add(LSTM(units=50, input_shape=(train_x.shape[0], 1), return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(units=50, return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(units=50, return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(units=25))
model.add(Dropout(0.2))
model.add(Dense(units=1))
model.compile(optimizer='adam', loss=tf.keras.losses.MeanSquaredError(), metrics=['accuracy'])
print(model.summary())
model.fit(train_x, train_y, epochs=100, batch_size=64)
 
and also extra questions
what is batch_size and units of lstm and droupout
thanks for help