An Open-Source and Reproducible Implementation of LSTM and GRU Networks for Time Series Forecasting

Gissel Velarde, Pedro Branez, Alejandro Bueno, Rodrigo Heredia, Mateo Lopez-Ledezma
4/25/2025
cs.LG

No confident code implementation found for this paper. 5 possible matches can be shown below.

Abstract

This paper introduces an open-source and reproducible implementation of Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) Networks for time series forecasting. We evaluated LSTM and GRU networks because of their performance reported in related work. We describe our method and its results on two datasets. The first dataset is the S&P BSE BANKEX, composed of stock time series (closing prices) of ten financial institutions. The second dataset, called Activities, comprises ten synthetic time series resembling weekly activities with five days of high activity and two days of low activity. We report Root Mean Squared Error (RMSE) between actual and predicted values, as well as Directional Accuracy (DA). We show that a single time series from a dataset can be used to adequately train the networks if the sequences in the dataset contain patterns that repeat, even with certain variation, and are properly processed. For 1-step ahead and 20-step ahead forecasts, LSTM and GRU networks significantly outperform a baseline on the Activities dataset. The baseline simply repeats the last available value. On the stock market dataset, the networks perform just like the baseline, possibly due to the nature of these series. We release the datasets used as well as the implementation with all experiments performed to enable future comparisons and to make our research reproducible.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 5 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{velarde2025opensource,
  title  = {An Open-Source and Reproducible Implementation of LSTM and GRU Networks for Time Series Forecasting},
  author = {Gissel Velarde and Pedro Branez and Alejandro Bueno and Rodrigo Heredia and Mateo Lopez-Ledezma},
  year   = {2025},
  eprint = {2504.18185},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.18185v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.18185.svg)](https://codeofpaper.com/paper/2504.18185)

Discussion