bioRxiv Science⌕ Search

bioRxiv · 10.1101/2020.09.30.321752

PsychRNN: An Accessible and Flexible Python Package for Training Recurrent Neural Network Models on Cognitive Tasks

Abstract

Task-trained artificial recurrent neural networks (RNNs) provide a computational modeling framework of increasing interest and application in computational, systems, and cognitive neuroscience. RNNs can be trained, using deep learning methods, to perform cognitive tasks used in animal and human experiments, and can be studied to investigate potential neural representations and circuit mechanisms underlying cognitive computations and behavior. Widespread application of these approaches within neuroscience has been limited by technical barriers in use of deep learning software packages to train network models. Here we introduce PsychRNN, an accessible, flexible, and extensible Python package for training RNNs on cognitive tasks. Our package is designed for accessibility, for researchers to define tasks and train RNN models using only Python and NumPy without requiring knowledge of deep learning software. The training backend is based on TensorFlow and is readily extensible for researchers with TensorFlow knowledge to develop projects with additional customization. PsychRNN implements a number of specialized features to support applications in systems and cognitive neuroscience. Users can impose neurobiologically relevant constraints on synaptic connectivity patterns. Furthermore, specification of cognitive tasks has a modular structure, which facilitates parametric variation of task demands to examine their impact on model solutions. PsychRNN also enables task shaping during training, or curriculum learning, in which tasks are adjusted in closed-loop based on performance. Shaping is ubiquitous in training of animals in cognitive tasks, and PsychRNN allows investigation of how shaping trajectories impact learning and model solutions. Overall, the PsychRNN framework facilitates application of trained RNNs in neuroscience research. Visual Abstract O_FIG O_LINKSMALLFIG WIDTH=200 HEIGHT=100 SRC="FIGDIR/small/321752v1_ufig1.gif" ALT="Figure 1"> View larger version (25K): org.highwire.dtl.DTLVardef@1541513org.highwire.dtl.DTLVardef@133c86borg.highwire.dtl.DTLVardef@aaf099org.highwire.dtl.DTLVardef@99d55b_HPS_FORMAT_FIGEXP M_FIG Example workflow for using PsychRNN. First, the task of interest is defined, and a recurrent neural network model is trained to perform the task, optionally with neurobiologically informed constraints on the network. After the network is trained, the researchers can investigate network properties including the synaptic connectivity patterns and the dynamics of neural population activity during task execution, and other studies, e.g. those on perturbations, can be explored. The dotted line shows the possible repetition of this cycle with one network, which allows investigation of training effects of task shaping, or curriculum learning, for closed-loop training of the network on a progression of tasks. C_FIG Significance StatementArtificial recurrent neural network (RNN) modeling is of increasing interest within computational, systems, and cognitive neuroscience, yet its proliferation as a computational tool within the field has been limited due to technical barriers in use of specialized deep-learning software. PsychRNN provides an accessible, flexible, and powerful framework for training RNN models on cognitive tasks. Users can define tasks and train models using the Python-based interface which enables RNN modeling studies without requiring user knowledge of deep learning software. PsychRNNs modular structure facilitates task specification and incorporation of neurobiological constraints, and supports extensibility for users with deep learning expertise. PsychRNNs framework for RNN modeling will increase accessibility and reproducibility of this approach across neuroscience subfields.

Source connections

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Ehrlich, D. B., Stone, J. T., Brandfonbrener, D., Atanasov, A., Murray, J. D.. 2020-10-01. PsychRNN: An Accessible and Flexible Python Package for Training Recurrent Neural Network Models on Cognitive Tasks. https://doi.org/10.1101/2020.09.30.321752

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related preprints

Epidermal Langerhans Cells Act as Neuroimmune Regulators of Pain and Itch

Neuroimmune interactions in the skin coordinate immune defense and somatosensory perception, yet how immune cells shape sensory signaling remains poorly defined. Here, we show that Langerhans cells (LCs), epidermal antigen-presenting cells, function as local immune-derived amplifiers of cutaneous sensory signaling. Anatomical and transcriptomic analyses reveal preferential LC association with non-peptidergic sensory neurons. LC activation increases neuronal and behavioral responses to thermal, mechanical, and pruritic stimuli without directly exciting sensory neurons, whereas LC inhibition or ablation selectively reduces pruritogen-evoked itch. We identified semaphorin 7A as a candidate LC-expressed mediator. Semaphorin 7A sensitized cultured sensory neurons to chloroquine and histamine, and neutralizing semaphorin 7A abolished the increase in chloroquine-evoked scratching produced by LC activation. Its receptor PlexinC1 was expressed by most MrgprA3 pruriceptors and blocking PlexinC1 reduced semaphorin 7A-evoked neuronal responses. Together, these findings identify epidermal LCs as local immune-derived amplifiers that regulate the responsiveness of cutaneous sensory circuits and identify semaphorin 7A as a mediator of LC-induced itch potentiation.

neuroscience↗

Feasible closed-loop stimulation for neural latent dynamics control

Modern neuroscience benefits from powerful computational and experimental methods for studying neural populations, including latent dynamics models that predict behavior with few dimensions. But despite their explanatory utility, latent factors are seldom targeted explicitly with experimental perturbations, leaving causal relationships to behavior and inferred dynamical landscapes untested. A promising solution is closed-loop, multi-channel optogenetic control, which, when paired with model predictions, could steer neural trajectories in real time--a feat impossible for traditional, hand-designed stimulation. However, because closed-loop latent control has not been demonstrated in vivo, the hardware and software requirements remain unclear--particularly the necessary stimulation dimensionality and how limited resources such as implant volume and bandwidth should be allocated between stimulation and recording capabilities. Preliminary experiments would thus help guide ongoing technological development. As large-scale exploration of these design spaces in vivo is prohibitively expensive, we conducted a high-throughput simulation survey using biophysically grounded spiking neural networks. We found that low-dimensional actuation is sufficient: in the reference configuration, ~20% of the stimulation channels achieved ~85% of peak control performance, far fewer than the number of neurons. Furthermore, allocating channels roughly equally between stimulation and recording optimized behavioral control, whereas pairing many electrodes with a single light source--the prevailing practice in experimental labs--performed poorly. Even without heavily optimizing modeling or control, we obtained >60% tracking error reduction and >90% evoked behavior accuracy on average for optimal channel counts. These results held across extensive parameter variations, suggesting that closed-loop latent control is feasible with accessible channel counts and establishing design principles for future tool development and in vivo experiments.

neuroscience↗

Identification of Kinome Biomarkers and Therapeutic Rescue in cGMP-Linked Retinal Degeneration

Inherited retinal degenerations, such as Retinitis Pigmentosa (RP) and Leber's congenital amaurosis (LCA), are major causes of progressive and irreversible vision loss. The large number of genes associated with these disorders makes their clinical and molecular characterization difficult, while systemic biomarkers for disease progression or treatment response remain limited. These challenges were addressed by targeting cGMP-associated mechanisms shared by RP and LCA and integrating systemic biomarker profiling with retinal outcomes. Kinase activity analysis (kinome analysis) in peripheral blood mononuclear cells distinguished healthy and diseased states and captured therapy-associated signatures in rd10 mice treated with LP-CN03, a liposomal formulation of the cGMP analog CN03. This first systemic analysis in a therapeutically responsive animal model highlights kinome analysis as a potential translational readout. Given shared cGMP signaling in RP and AIPL1-associated LCA, LP-CN03's therapeutic potential was further evaluated in a new CRISPR-Cas9-generated Aipl1-/- mouse model. Treatment with LP-CN03 preserved retinal structure and function, as shown by electroretinography, longitudinal optical coherence tomography, fundus imaging, optomotor testing, and photoreceptor-specific gene expression. Together, these findings provide independent in vivo evidence for the neuroprotective effect of LP-CN03 in both cGMP-related RP and LCA, also highlighting the translational value of kinome profiling.

neuroscience↗