# Data-Driven Predictive Modeling of Neuronal Dynamics Using Long Short-Term Memory
## 3 Simulation Results
### Regular Spiking  
In this section, we demonstrate the efficacy of our trained deep LSTM neural network over the range of external current between 2.3 nA and 3 nA in predicting the regular spiking dynamics shown by the biophysiological Hodgkin-Huxley model of CA1 pyramidal neuron in response to the external current \(I\geq 2.3\) nA. In this range, we observe firing rates between approximately 165 Hz and 187 Hz. For clarity, we here show our results only for the membrane potential traces. We provide the complete set of simulation results on the LSTM network performance in predicting the dynamics of all the 9 states of the Hodgkin-Huxley model in Appendix B.1 (see Figures A1-A5). Figure 7 shows a comparison of the membrane potential traces simulated using the Hodgkin-Huxley model and the 4 different predictive horizons of the LSTM network (i.e., 1 timestep, 50 timesteps, 100 timesteps and 200 timesteps, which we represent as \(N_{p}=1,50,100,200\)) for the external stimulating current \(I=3.0\) nA. Note that all the simulations are performed using the same initial condition as provided in Appendix A. Since our LSTM network uses the initial sequence of outputs of appropriate predictive horizon (i.e., \(N_{p}=1,50,100,200\)) from the Hodgkin-Huxley model to make future time predictions, the LSTM network predictions (shown by dashed red line) start after 0.1 ms, 5 ms, 10 ms, and 20 ms in Figure 7a-d, respectively. Figure 6: Training and validation loss for the deep long short term memory (LSTM) neural network with multi-timestep predictive horizon. (**a**) 1 timestep predictive horizon. (**b**) 50 timesteps predictive horizon. (**c**) 100 timesteps predictive horizon. (**d**) 200 timesteps predictive horizon. As shown in Figure 7, the iterative prediction of the membrane potential traces by the LSTM network did not differ significantly over a short time horizon (up to 200 ms) for \(N_{p}=1,50,100,200\), but it significantly improved afterward with the increased predictive horizon of the LSTM network (i.e., \(N_{p}=1\) to \(N_{p}=200\)). In particular, the LSTM network performance significantly improved in predicting the timing of the occurrence of spikes, but the magnitude of the membrane potential traces during spikes degraded as we increased \(N_{p}\) from 1 to 200. For clarity, we also computed the time-averaged root mean squared error (RMSE) of the membrane potential traces between the  
Figure 7: Comparison of predicted membrane potential traces by the deep LSTM neural network (“LSTM Network”) to the regular spiking pattern exhibited by the Hodgkin-Huxley model (“HH Model”) in response to the external stimulating current \(I=3.0\) nA. (**a**) Prediction using 1 timestep predictive LSTM network (\(N_{p}=1\)). (**b**) Prediction using 50 timesteps predictive LSTM network (\(N_{p}=50\)). (**c**) Prediction using 100 timesteps predictive LSTM network (\(N_{p}=100\)). (**d**) Prediction using 200 timesteps predictive LSTM network (\(N_{p}=200\)). Hodgkin-Huxley model and the LSTM network for \(N_{p}=1,50,100,200\) over 500 ms of simulation time. Figure 8a shows that the time-averaged RMSE decreased consistently with the increased predictive horizon of the LSTM network. Overall, these results show that our LSTM network with a longer predictive horizon prefers to capture temporal correlations more accurately over the amplitude while an LSTM network with a shorter predictive horizon prefers to capture the amplitude more accurately over the temporal correlations. To systematically evaluate whether the designed LSTM networks provide reasonable predictions of the membrane potential traces of the regular spiking dynamics across the range of external input currents between 2.3 nA and 3.0 nA, we performed simulations for 50 random stimulating currents drawn from a Uniform distribution \(\mathcal{U}(2.3,3.0)\).