title: Keras - val_accuraccy stuck at 0.0000e+00 in LSTM model
body: <p>Below is my Keras model for predicting cryptocurrency prices. The problem is although the <code>loss</code> and <code>val_loss</code> decreases, the <code>accuracy</code> is stuck at a certain value (<code>2.5840e-04</code>) and doesn't change, and the <code>val_accuracy</code> is stuck at <code>0.0000e+00</code>. I checked each of my inputs thoroughly, but I couldn't find anything wrong. Is there a problem with my model?</p>
  <p><a href="https://www.kaggle.com/vdsgdjhgf/dataset-test" rel="nofollow noreferrer">(This is a link to my notebook if you need)</a></p>
  <p>This is my data preparation (ethusd.csv is a standard stock format dataset. you can see it in my notebook in the link above)</p>
  <pre><code>DATASET_PATH = &quot;../input/crifier/ethusd.csv&quot;
  
  import math
  import matplotlib.pyplot as plt
  import tensorflow.keras as keras
  import pandas as pd
  import numpy as np
  from tensorflow.keras.models import Sequential
  from tensorflow.keras.layers import Dense
  from tensorflow.keras.layers import LSTM
  from tensorflow.keras.layers import Dropout
  from tensorflow.keras.layers import *
  from sklearn.preprocessing import MinMaxScaler
  from sklearn.metrics import mean_squared_error
  from sklearn.metrics import mean_absolute_error
  from sklearn.model_selection import train_test_split
  from tensorflow.keras.callbacks import EarlyStopping
  from tensorflow.keras.optimizers import Adam
  import tensorflow as tf
  from sklearn.utils import shuffle
  
  df=pd.read_csv(DATASET_PATH)
  df = df[-100000:-90000]
  
  global WINDOW
  global LEN_TRAIN
  
  WINDOW = 400
  TRAIN_RATIO = 0.9
  
  LEN_TRAIN = int(LEN_DF*TRAIN_RATIO)
  LEN_TEST = int(LEN_DF - LEN_TRAIN)
  
  training_set = df.iloc[:LEN_TRAIN, 1:2].values
  test_set = df.iloc[LEN_TRAIN:, 1:2].values
  
  def reshaper(dataset):
      
      sc = MinMaxScaler(feature_range = (0, 1))
      
      dataset_scaled = sc.fit_transform(dataset)
      # Creating a data structure with 60 time-steps and 1 output
      X_scaled = []
      y_scaled = []
      for i in range(0, len(dataset)-WINDOW):
          X_scaled.append(dataset_scaled[i:i+WINDOW, 0])
          y_scaled.append(dataset_scaled[i+WINDOW, 0])
      X_scaled, y_scaled = np.array(X_scaled), np.array(y_scaled)
      X_scaled = np.reshape(X_scaled, (X_scaled.shape[0], X_scaled.shape[1], 1))
      return X_scaled, y_scaled,sc
  
  X_train, y_train, sc_train = reshaper(training_set)
  
  X_train, y_train = shuffle(X_train, y_train)
  
  X_test, y_test, sc_test = reshaper(test_set)
  </code></pre>
  <p>And this is my model</p>
  <pre><code>model = Sequential()
  #Adding the first LSTM layer and some Dropout regularisation
  model.add(LSTM(units = 50, return_sequences = True, input_shape = (X_train.shape[1], 1)))
  model.add(Dropout(0.2))
  # Adding a second LSTM layer and some Dropout regularisation
  model.add(LSTM(units = 50, return_sequences = True))
  model.add(Dropout(0.2))
  # Adding a third LSTM layer and some Dropout regularisation
  model.add(LSTM(units = 50, return_sequences = True))
  model.add(Dropout(0.2))
  # Adding a fourth LSTM layer and some Dropout regularisation
  model.add(LSTM(units = 50))
  model.add(Dropout(0.2))
  # Adding the output layer
  model.add(Dense(units = 1))
  
  # Compiling the RNN
  model.compile(optimizer = Adam(learning_rate=0.001), loss = 'mean_squared_error',metrics=['accuracy'])
  model.fit(X_train, y_train, validation_split=0.1, epochs = 100, batch_size = 1000, verbose=2)
  </code></pre>
  <p>I keep getting the following accuracy and val_accuracy</p>
  <pre><code>Epoch 1/100
  8/8 - 3s - loss: 0.0991 - accuracy: 1.2920e-04 - val_loss: 0.0046 - val_accuracy: 0.0000e+00
  Epoch 2/100
  8/8 - 2s - loss: 0.0217 - accuracy: 2.5840e-04 - val_loss: 0.0068 - val_accuracy: 0.0000e+00
  Epoch 3/100
  8/8 - 2s - loss: 0.0132 - accuracy: 2.5840e-04 - val_loss: 0.0047 - val_accuracy: 0.0000e+00
   .
   .
   .
  Epoch 28/100
  8/8 - 2s - loss: 0.0036 - accuracy: 2.5840e-04 - val_loss: 0.0011 - val_accuracy: 0.0000e+00
  Epoch 29/100
  8/8 - 2s - loss: 0.0034 - accuracy: 2.5840e-04 - val_loss: 0.0012 - val_accuracy: 0.0000e+00
  Epoch 30/100
  8/8 - 2s - loss: 0.0033 - accuracy: 2.5840e-04 - val_loss: 0.0011 - val_accuracy: 0.0000e+00
  </code></pre>