Why is my LSTM, stateful network getting 0 accuracy I'm building a NN to predict stock prices but I'm getting an accuracy of 0, I really don't know what hyper parameters to play with anymore but it seems to always get this accuracy

Build LSTM model


model.add(LSTM(
    50, activation="tanh", recurrent_activation="sigmoid",
    return_sequences=True, batch_input_shape=(batch, timesteps, features)))#stateful=True,
model.add(layers.Dropout(0.2))

model.add(LSTM(100, activation="tanh", recurrent_activation="sigmoid",
               stateful=True, return_sequences=True)) #stateful=True
model.add(layers.Dropout(0.4))

model.add(layers.LSTM(50, activation="tanh", recurrent_activation="sigmoid",
               stateful=True, return_sequences=False)) #stateful=True
model.add(layers.Dropout(0.2))

model.add(Dense(25))
model.add(Dense(1))

# Complie model
model.compile(optimizer="adam", loss="mean_squared_error",
              metrics=["accuracy", "mse"])

# Train the model
for i in trange(1, desc="Training the fuck out of this model"):
    model.fit(x_train, y_train,
              batch_size=batch, epochs=1,
              shuffle=False)#shuffle=False
    model.reset_states()```

#OUTPUT
```Epoch 1/1

   1/2918 [..............................] - ETA: 1:47:06 - loss: 0.0318 - acc: 0.0000e+00 - mean_squared_error: 0.0318
   2/2918 [..............................] - ETA: 56:57 - loss: 0.0246 - acc: 0.0000e+00 - mean_squared_error: 0.0246  
   3/2918 [..............................] - ETA: 40:29 - loss: 0.0174 - acc: 0.0000e+00 - mean_squared_error: 0.0174
   4/2918 [..............................] - ETA: 32:15 - loss: 0.0135 - acc: 0.0000e+00 - mean_squared_error: 0.0135
   5/2918 [..............................] - ETA: 27:18 - loss: 0.0141 - acc: 0.0000e+00 - mean_squared_error: 0.0141
   6/2918 [..............................] - ETA: 24:00 - loss: 0.0150 - acc: 0.0000e+00 - mean_squared_error: 0.0150
   7/2918 [..............................] - ETA: 21:40 - loss: 0.0142 - acc: 0.0000e+00 - mean_squared_error: 0.0142
   8/2918 [..............................] - ETA: 19:48 - loss: 0.0125 - acc: 0.0000e+00 - mean_squared_error: 0.0125
   9/2918 [..............................] - ETA: 18:26 - loss: 0.0115 - acc: 0.0000e+00 - mean_squared_error: 0.0115
  10/2918 [..............................] - ETA: 17:20 - loss: 0.0108 - acc: 0.0000e+00 - mean_squared_error: 0.0108
  11/2918 [..............................] - ETA: 16:27 - loss: 0.0100 - acc: 0.0000e+00 - mean_squared_error: 0.0100
  12/2918 [..............................] - ETA: 15:42 - loss: 0.0094 - acc: 0.0000e+00 - mean_squared_error: 0.0094
  13/2918 [..............................] - ETA: 15:08 - loss: 0.0089 - acc: 0.0000e+00 - mean_squared_error: 0.0089
  14/2918 [..............................] - ETA: 14:32 - loss: 0.0083 - acc: 0.0000e+00 - mean_squared_error: 0.0083
  15/2918 [..............................] - ETA: 14:06 - loss: 0.0080 - acc: 0.0000e+00 - mean_squared_error: 0.0080
  16/2918 [..............................] - ETA: 13:39 - loss: 0.0076 - acc: 0.0000e+00 - mean_squared_error: 0.0076
  17/2918 [..............................] - ETA: 13:17 - loss: 0.0072 - acc: 0.0000e+00 - mean_squared_error: 0.0072
  18/2918 [..............................] - ETA: 12:58 - loss: 0.0068 - acc: 0.0000e+00 - mean_squared_error: 0.0068
  19/2918 [..............................] - ETA: 12:40 - loss: 0.0065 - acc: 0.0000e+00 - mean_squared_error: 0.0065```
Your code is absolutely fine. Also, the model is working as you can see the loss is continuously decreasing.

The thing is, this is a regression problem and accuracy is used for classification tasks. It just calculates how often predictions match labels by comparing if the classes are the same. See here for more details on how it works. So, just remove accuracy from your metrics and you are good to go.