Contents
Why are predictions from my LSTM neural network?
I am running an LSTM neural network in R using the keras package, in an attempt to do time series prediction of Bitcoin. The issue I’m running into is that while my predicted values seem to be reasonable, for some reason, they are “lagging” or “behind” the true values.
Why is Keras LSTM accuracy stuck at 50%?
Could be a simple error you did in the code (maybe while extracting the dataset) that we can’t see in your code sample. The constant loss you showed is a very weird behaviour indeed. Anyway… You are trying something really ambitious without a pre-trained embedding like word2vec and an architecture so simple.
Why is the accuracy always 0 in TensorFlow?
You are using linear (the default one) as an activation function in the output layer (and relu in the layer before). Your loss is loss=’mean_squared_error’. However, the metric that you use- metrics= [‘accuracy’] corresponds to a classification problem. If you want to do regression, remove metrics= [‘accuracy’].
Is it possible to train LSTM with random embedding?
I suggest you to give a look at my github repo where (if you are really interested in not using pre-trained embedding) there is an example that starts with random embedding and adjust it while training reaching 87.72% on the TestSet with a CNN. You can easily convert it to LSTM.
Do you have to normalize return sequences for LSTM?
First, it’s a good idea to keep your values between -1 and +1, so I’d normalize them first. For the LSTM model, you must make sure you’re using return_sequences=True. There is nothing “wrong” with your model, but it may need more or less layers or units to achieve what you desire.
How to predict a multiple forward time step of a time?
I’m training the model with a 52 input layer (the given time series of previous year) and 52 predicted output layer (the time series of next year). The shape of train_X is (X_examples, 52, 1), in other words, X_examples to train, 52 timesteps of 1 feature each.
Can a keras model predict a time series?
My thought was that the algorithm will predict the values as a time series instead of isolated values (am I correct?) The model’s code in Keras is: