A PyTorch time-series pipeline over a decade of Indonesian gold prices: sixty-day sequences, eleven engineered features, and two architectures — a stacked LSTM with a dense head, and a bidirectional variant with an additive attention layer and batch normalisation. Forecasts are generated at horizons from one month to five years and written out as CSV series and plots.
Ten and fifteen year price histories go in; sequences of sixty days across eleven features come out, normalised and split into train, validation and test. Training uses Adam with weight decay, MSE, and a plateau-triggered learning-rate reduction.
The second architecture is the more interesting one: a bidirectional stack whose outputs pass through an additive attention layer, so the prediction is a weighted sum over the whole window rather than whatever the final timestep happened to hold. Batch normalisation sits between the dense layers.
The pipeline will happily produce a daily price series five years out, and the plots look convincing. They are not a forecast in any useful sense: each step is fed the model’s own previous output, so error compounds, and nothing in the input describes the things that actually move gold prices over five years.
The companion project that implements an LSTM from scratch put the same class of model through a full evaluation harness and recorded a negative R² and a 25-point loss against buy-and-hold. That result applies here too, and it is the reason both are filed as research rather than as anything to trade on.