
Understanding LSTMs – Part 7: LSTM in Action with Real Data
In the previous article, we completed all three stages of the LSTM: the Forget Gate , Input Gate , and Output Gate . Now, let us use the LSTM with real data . Dataset Here we have stock prices for two companies: Company A Company B On the y-axis , we have the stock value. On the x-axis , we have the day the value was recorded. If we overlap the data for both companies, we observe that the only difference occurs between Day 1 and Day 5 . We will sequentially pass the data from Day 1 through Day 4 into an unrolled LSTM and see whether it can correctly predict the value for Day 5 for both companies. Initializing the LSTM We begin by initializing the long-term and short-term memories to zero: To maintain a clear overview as we proceed, we will use the following simplified diagram from time to time: Company A We now sequentially pass Company A’s values from Day 1 through Day 4 into the LSTM. Day 1 We start by plugging in the value for Day 1, which is 0 , into the input. After performing the
Continue reading on Dev.to
Opens in a new tab


