NeuralFlow: modeling neural activity with continuous latent Langevin dynamics
NeuralFlow is a Python package for modeling neural spiking activity with continuous latent Langevin dynamics. The driving force is optimized from data by gradient descent algorithm directly in the space of continuous functions. Nonstationary data distribution can be modeled by inferring initial distribution of the latent states and noise magnitude from data using absorbing or reflecting boundary conditions. Each neuron has its own tuning function f(x) that links neuron’s firing rate to the latent state.
The modeling results can be interpreted within the dynamical system theory. The package includes optimization functions (ADAM and Gradient-descent), data generation functions for generating spike data from a specific Langevin model, and the core modules like spike data, PDE solver, and model. Viterbi algorithm for inferring the most probable path is also included.
In addition, we include feature consistency analysis for model selection based on feature consistency between the models optimized on two data samples.
To get started, see examples. For deeper understanding of the code, refer to the unit tests. For more information, see Genkin and Engel (2020) [1], Genkin, Hughes and Engel (2020) [2], and Genkin et al. (2023) [3]