<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Archiving and Interchange DTD v2.3 20070202//EN" "archivearticle.dtd">
<article xml:lang="EN" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="methods-article">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Syst. Neurosci.</journal-id>
<journal-title>Frontiers in Systems Neuroscience</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Syst. Neurosci.</abbrev-journal-title>
<issn pub-type="epub">1662-5137</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/fnsys.2024.1269190</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Neuroscience</subject>
<subj-group>
<subject>Methods</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>Exploring Flip Flop memories and beyond: training Recurrent Neural Networks with key insights</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes">
<name><surname>Jarne</surname> <given-names>Cecilia</given-names></name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<xref ref-type="aff" rid="aff2"><sup>2</sup></xref>
<xref ref-type="aff" rid="aff3"><sup>3</sup></xref>
<xref ref-type="corresp" rid="c001"><sup>&#x0002A;</sup></xref>
<uri xlink:href="http://loop.frontiersin.org/people/743938/overview"/>
<role content-type="https://credit.niso.org/contributor-roles/conceptualization/"/>
<role content-type="https://credit.niso.org/contributor-roles/formal-analysis/"/>
<role content-type="https://credit.niso.org/contributor-roles/investigation/"/>
<role content-type="https://credit.niso.org/contributor-roles/methodology/"/>
<role content-type="https://credit.niso.org/contributor-roles/resources/"/>
<role content-type="https://credit.niso.org/contributor-roles/software/"/>
<role content-type="https://credit.niso.org/contributor-roles/validation/"/>
<role content-type="https://credit.niso.org/contributor-roles/visualization/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-original-draft/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
</contrib>
</contrib-group>
<aff id="aff1"><sup>1</sup><institution>Departamento de Ciencia y Tecnologia de la Universidad Nacional de Quilmes, Bernal, Quilmes</institution>, <addr-line>Buenos Aires</addr-line>, <country>Argentina</country></aff>
<aff id="aff2"><sup>2</sup><institution>CONICET</institution>, <addr-line>Buenos Aires</addr-line>, <country>Argentina</country></aff>
<aff id="aff3"><sup>3</sup><institution>Department of Clinical Medicine, Center of Functionally Integrative Neuroscience, Aarhus University</institution>, <addr-line>Aarhus</addr-line>, <country>Denmark</country></aff>
<author-notes>
<fn fn-type="edited-by"><p>Edited by: Susan E. Shore, University of Michigan, United States</p></fn>
<fn fn-type="edited-by"><p>Reviewed by: Alianna Maren, Themesis, Inc., United States</p>
<p>Shuangming Yang, Tianjin University, China</p></fn>
<corresp id="c001">&#x0002A;Correspondence: Cecilia Jarne <email>cecilia.jarne&#x00040;unq.edu.ar</email></corresp>
</author-notes>
<pub-date pub-type="epub">
<day>27</day>
<month>03</month>
<year>2024</year>
</pub-date>
<pub-date pub-type="collection">
<year>2024</year>
</pub-date>
<volume>18</volume>
<elocation-id>1269190</elocation-id>
<history>
<date date-type="received">
<day>29</day>
<month>07</month>
<year>2023</year>
</date>
<date date-type="accepted">
<day>11</day>
<month>03</month>
<year>2024</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#x000A9; 2024 Jarne.</copyright-statement>
<copyright-year>2024</copyright-year>
<copyright-holder>Jarne</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p></license>
</permissions>
<abstract>
<p>Training neural networks to perform different tasks is relevant across various disciplines. In particular, Recurrent Neural Networks (RNNs) are of great interest in Computational Neuroscience. Open-source frameworks dedicated to Machine Learning, such as Tensorflow and Keras have produced significant changes in the development of technologies that we currently use. This work contributes by comprehensively investigating and describing the application of RNNs for temporal processing through a study of a 3-bit Flip Flop memory implementation. We delve into the entire modeling process, encompassing equations, task parametrization, and software development. The obtained networks are meticulously analyzed to elucidate dynamics, aided by an array of visualization and analysis tools. Moreover, the provided code is versatile enough to facilitate the modeling of diverse tasks and systems. Furthermore, we present how memory states can be efficiently stored in the vertices of a cube in the dimensionally reduced space, supplementing previous results with a distinct approach.</p></abstract>
<kwd-group>
<kwd>recurrent neural networks</kwd>
<kwd>dynamics</kwd>
<kwd>computational neuroscience</kwd>
<kwd>flip flop</kwd>
<kwd>eigenvalue distribution</kwd>
</kwd-group>
<counts>
<fig-count count="7"/>
<table-count count="1"/>
<equation-count count="8"/>
<ref-count count="68"/>
<page-count count="13"/>
<word-count count="8341"/>
</counts>
</article-meta>
</front>
<body>
<sec sec-type="intro" id="s1">
<title>1 Introduction</title>
<p>Machine learning methods, especially Deep Learning, have achieved remarkable success across diverse tasks in various domains. These include speech processing (Ogunfunmi et al., <xref ref-type="bibr" rid="B44">2019</xref>), bioinformatics (Min et al., <xref ref-type="bibr" rid="B41">2016</xref>), where algorithms predict protein structures, discover drugs and analyze gene expression data, and image recognition (Litjens et al., <xref ref-type="bibr" rid="B37">2017</xref>) where deep learning classifies images and detects objects.</p>
<p>The emergence of open-source frameworks dedicated to Machine Learning, such as Pytorch, Tensorflow and Keras (Abadi et al., <xref ref-type="bibr" rid="B1">2015</xref>; Chollet et al., <xref ref-type="bibr" rid="B10">2015</xref>; Paszke et al., <xref ref-type="bibr" rid="B47">2019</xref>) has produced huge changes in the development of technologies we use every day for different tasks in research. Due to their novelty and complexity, it can be challenging to properly learn how to utilize these frameworks in different relevant scientific domains, such as the development of models in Computational Neuroscience, which will be the aim of the present work.</p>
<p>To bridge the gap between theoretical knowledge and practical application, clear tutorials or primers are crucial. These resources should equip researchers not only with the ability to implement the algorithms but also with the skills to solve diverse problems pertinent to their field.</p>
<p>Recurrent Neural Networks (or RNNs) were originally invented by Paul Werbos, who also invented backpropagation, a fundamental tool for training these models (Werbos, <xref ref-type="bibr" rid="B59">1990</xref>). This also includes the concept of latent variables. The problem of training neural networks to perform different tasks is relevant across various disciplines that go beyond Machine Learning. In particular, RNNs are of great interest in different scientific communities. These models also have great relevance concerning control systems and other areas such as electronics (Alianna J. Maren and, Auth.; Deng, <xref ref-type="bibr" rid="B14">2013</xref>; Dinh et al., <xref ref-type="bibr" rid="B16">2014</xref>; Mohajerin and Waslander, <xref ref-type="bibr" rid="B42">2017</xref>). One relevant problem to address with them is how to build models for the study of dynamical systems and how to extract meaningful information from them.</p>
<p>In general, Neural Networks are algorithms that allow us to model different systems. According to the Universal Approximation Theorem, a neural network with one hidden layer containing a sufficient but finite number of neurons can approximate any continuous function to a reasonable accuracy under certain conditions for activation functions (Hornik, <xref ref-type="bibr" rid="B25">1991</xref>). This theorem has been extended to RNNs. It is well known that dynamical systems can be approximated by continuous-time RNNs (Funahashi and Nakamura, <xref ref-type="bibr" rid="B20">1993</xref>).</p>
<p>In particular, RNNs are widely used in the field of Computational Neurosciences to describe the behavior of cortical areas, which presents great recurrence in their connections (Murphy and Miller, <xref ref-type="bibr" rid="B43">2009</xref>). They are related to the processing of temporal information and the production of time-dependent outputs.</p>
<p>The basic premise of RNNs is that the feedforward connection weights in a Multilayer Perceptron (MLP) neural network (McCulloch and Pitts, <xref ref-type="bibr" rid="B40">1943</xref>) can be modified using prior activation history as well as the immediately presented stimulus. This mechanism can be considered to encapsulate, in a very simple model, the much broader and more interesting task of guiding neural behavior. Factors that influence neural interactions and even growth can be included within this simple model. In this context, the broader scope of systems neuroscience relates to a detailed and careful analysis of RNNs.</p>
<p>The realm of temporal influence within systems neuroscience has a long and substantive history. The work by Levi-Montalcini and Booker (<xref ref-type="bibr" rid="B36">1960</xref>); Levi-Montalcini (<xref ref-type="bibr" rid="B35">1987</xref>), was among the earliest to show how specific signaling proteins (nerve growth factors, or NGFs) could influence temporal evolution within an organism. More recently, Baldassarro et al. (<xref ref-type="bibr" rid="B4">2023</xref>) showed, in an in vitro study, that NGFs could influence the proliferation of fetal brain multipotent stem cells, pushing them into a specific oligodendrocyte cell lineage and also influencing the differentiation of oligodendrocyte precursor cells. These works are simply examples of how the complex process of influencing neural cell growth and differentiation can be influenced over time, by introducing specific signaling mechanisms. For this, the notion of RNNs encapsulates a much larger suite of neural processes.</p>
<p>In this way, RNNs allow the incorporation of realistic characteristics at the biological level, such as Dale&#x00027;s law (Dale, <xref ref-type="bibr" rid="B13">1935</xref>; Rajan and Abbott, <xref ref-type="bibr" rid="B49">2006</xref>; Song et al., <xref ref-type="bibr" rid="B54">2016</xref>; Jarne and Caruso, <xref ref-type="bibr" rid="B29">2023</xref>), sparsity or different characteristics of interest in animal models.</p>
<p>In the field of Machine learning, more sophisticated architectures such as LSTM (Long Short Term Memory units) or GRU (Gated recurrent units) are widely spread and have been used to process temporal sequences since they do not have the same limitations as RNNs to process long time dependencies (Bengio et al., <xref ref-type="bibr" rid="B6">1994</xref>; Pascanu et al., <xref ref-type="bibr" rid="B46">2013</xref>; Chung et al., <xref ref-type="bibr" rid="B11">2014</xref>; SHI et al., <xref ref-type="bibr" rid="B52">2015</xref>; Gudowska-Nowak et al., <xref ref-type="bibr" rid="B21">2020</xref>). Other powerful models are based on spiking neural networks (SNNs). Several recent studies have made significant contributions to the field of brain-inspired intelligence. These studies demonstrate the potential of this field to achieve high-level intelligence, high accuracy, high robustness, and low power consumption (Yang et al., <xref ref-type="bibr" rid="B64">2022a</xref>,<xref ref-type="bibr" rid="B66">b</xref>, <xref ref-type="bibr" rid="B65">2023</xref>; Yang and Chen, <xref ref-type="bibr" rid="B62">2023a</xref>,<xref ref-type="bibr" rid="B63">b</xref>).</p>
<p>The primary reason for using simple RNN models lies in their ability to comprehend neural computation through collective dynamics, a phenomenon intricately linked to motor control, brain temporal tasks, decision-making (Mante et al., <xref ref-type="bibr" rid="B39">2013</xref>), neural oscillations and working memory (Vyas et al., <xref ref-type="bibr" rid="B58">2020</xref>; Jarne and Caruso, <xref ref-type="bibr" rid="B29">2023</xref>; Pals et al., <xref ref-type="bibr" rid="B45">2024</xref>).</p>
<p>Analyzing the dynamics inherent in these models allows us to formulate various hypotheses regarding the functioning of different brain areas and to offer an interpretation for the experimental results observed (Barak, <xref ref-type="bibr" rid="B5">2017</xref>; Kao and Hennequin, <xref ref-type="bibr" rid="B31">2019</xref>). An illustrative instance involves the recent utilization of RNNs to transfer learned dynamics and constraints to a spiking recurrent neural network in a one-to-one fashion (Kim et al., <xref ref-type="bibr" rid="B33">2019</xref>).</p>
<p>A well-established fact is that the dynamics of a network are heavily influenced by the eigenvalue spectrum of the weight matrix describing synaptic connections (Zhou et al., <xref ref-type="bibr" rid="B68">2009</xref>). Thus, the significance of investigating this distribution lies in elucidating various aspects of the dynamic behavior of the system, which is why, in Section 5.2, such analysis will be presented and described.</p>
<p>There are general tutorials available on artificial neural networks, such as Yang and Wang (<xref ref-type="bibr" rid="B61">2020</xref>). However, in this work, we will focus extensively on RNNs and their application in Computational Neuroscience because they play a relevant role in understanding complex neural processes and dynamics. Throughout this tutorial, we will delve into the architecture, training methodologies, and practical aspects of the RNN implementation. We explore also their significance and potential contributions to the field.</p>
<p>A simple RNN was chosen and trained to perform a time-series processing task inspired by Computational Neuroscience studies (Sussillo, <xref ref-type="bibr" rid="B55">2014</xref>). The implementation of the network, the training, and the tools are carefully described here, as well as different forms to obtain the information that allows a suitable description of the system under study.</p>
<p>Training an RNN to perform temporal tasks has many difficulties and can be done through various paradigms. Here it is proposed to approach the problem through supervised learning. The entire procedure is described in detail.</p>
<p>Among the different tasks, the Flip Flop was chosen as a case example. On one hand, a Flip Flop is the simplest sequential system that one can build Floyd (<xref ref-type="bibr" rid="B18">2003</xref>). To be precise, a 3-bit memory was studied, which is a task composed of a set of Flip Flops as the one shown in <xref ref-type="fig" rid="F1">Figure 1</xref>. This is also a working memory task considered previously in other works in Computational Neuroscience (Sussillo and Barak, <xref ref-type="bibr" rid="B57">2013</xref>; Barak, <xref ref-type="bibr" rid="B5">2017</xref>; Jarne, <xref ref-type="bibr" rid="B28">2022</xref>). The parameterization of the chosen task, one fundamental key in any work related to trained RNNs, is as described in Sussillo and Barak (<xref ref-type="bibr" rid="B57">2013</xref>). It is also revisited here. Gradient descendant minimization was used to take advantage of different optimized implementations of the available algorithms. The code implementation is presented using Tensorflow and Keras. The reason for this choice is that such scientific libraries are open-source, their use is rapidly growing, and they are becoming increasingly popular. One can find excellent documentation for software development about them Gulli and Pal (<xref ref-type="bibr" rid="B22">2017</xref>); Ramsundar and Zadeh (<xref ref-type="bibr" rid="B50">2018</xref>); Singh and Manure (<xref ref-type="bibr" rid="B53">2019</xref>). Also, we have new tools such as Google Colaboratory that allow implementing and testing models directly online.</p>
<fig id="F1" position="float">
<label>Figure 1</label>
<caption><p>A Flip Flop. Binary task designed to store one bit of information. It has two inputs, Set (S) and Reset (R), which in here will be represented by the temporal signal states of <italic>B</italic><sub>0</sub> &#x0002B;1 and -1 in amplitude, and one output Q. The output represents the current state of the Flip Flop and can be either 1 or -1.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fnsys-18-1269190-g0001.tif"/>
</fig>
<p>The focus of this paper is on elucidating how a trained RNN operates, with code provided for detailed study. The &#x0201C;Flip Flop problem&#x0201D; is chosen to illustrate the study. Every step is thoroughly explained, from parameterizing the task to describing the dynamics of trained networks.This example is used to show how the problem of training networks can be studied using these computing tools applied in any temporal task in general, but also to discuss the limitations that networks have and the alternatives to solve them.</p>
<p>The rest of the paper is organized as follows. In Section 2, the description of the dynamics, discretization and code examples are presented. In Section 3, the task parametrization is shown. Section 4 describes the training protocol. In Section 5, the results, different analyses of the network, tools and software are discussed in detail. Finally, Section 6 includes the final remarks.</p></sec>
<sec id="s2">
<title>2 Model</title>
<p>The dynamics of the units in the RNN model is inspired by <xref ref-type="disp-formula" rid="E1">Equation 1</xref>, based on a model for a large network of neurons with a graded response (Hopfield, <xref ref-type="bibr" rid="B24">1984</xref>).</p>
<disp-formula id="E1"><label>(1)</label><mml:math id="M1"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mfrac><mml:mrow><mml:mi>d</mml:mi><mml:msub><mml:mrow><mml:mi>h</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>h</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>&#x003C4;</mml:mi></mml:mrow></mml:mfrac><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003C3;</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:msubsup><mml:mrow><mml:mi>W</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mstyle mathvariant="monospace"><mml:mi>r</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi></mml:mstyle></mml:mrow></mml:msubsup><mml:msub><mml:mrow><mml:mi>h</mml:mi></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>M</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:msubsup><mml:mrow><mml:mi>W</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mi>k</mml:mi></mml:mrow><mml:mrow><mml:mstyle mathvariant="monospace"><mml:mi>i</mml:mi><mml:mi>n</mml:mi></mml:mstyle></mml:mrow></mml:msubsup><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>The dynamics of the RNN model of <italic>N</italic> units is described in terms of the activity column vector function <inline-formula><mml:math id="M2"><mml:mstyle mathvariant='bold-italic'><mml:mi>h</mml:mi></mml:mstyle><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>h</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mo>&#x022EF;</mml:mo><mml:mspace width="0.3em" class="thinspace"/><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>h</mml:mi></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>&#x1D531;</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula>, where &#x1D531; represent the matrix transposition. The <italic>i</italic>&#x02212;activity component <italic>h</italic><sub><italic>i</italic></sub>, where <italic>i</italic> &#x0003D; 1, &#x022EF;&#x02009;, <italic>N</italic> satisfies the differential equation as a function of time <italic>t</italic>. &#x003C4; represent a characteristic time of the system and &#x003C3; is a non-linear activation function. The elements <inline-formula><mml:math id="M3"><mml:msubsup><mml:mrow><mml:mi>W</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mstyle mathvariant="monospace"><mml:mi>r</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi></mml:mstyle></mml:mrow></mml:msubsup></mml:math></inline-formula> are the synaptic connection strengths of to the recurrent weight matrix <italic><bold>W</bold></italic><sup><italic>rec</italic></sup>&#x02208;&#x0211D;<sup><italic>N</italic>&#x000D7;<italic>N</italic></sup> and <italic><bold>x</bold></italic><sub><italic>k</italic></sub> are the component of the column vector function of input signal <inline-formula><mml:math id="M4"><mml:mi>x</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mo>&#x022EF;</mml:mo><mml:mspace width="0.3em" class="thinspace"/><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mi>M</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>&#x1D531;</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula>. The elements <inline-formula><mml:math id="M5"><mml:msubsup><mml:mrow><mml:mi>W</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mi>k</mml:mi></mml:mrow><mml:mrow><mml:mstyle mathvariant="monospace"><mml:mi>i</mml:mi><mml:mi>n</mml:mi></mml:mstyle></mml:mrow></mml:msubsup></mml:math></inline-formula> conform the input weight matrix <italic><bold>W</bold></italic><sup><italic>in</italic></sup>&#x02208;&#x0211D;<sup><italic>N</italic>&#x000D7;<italic>M</italic></sup> which connects the input signal <italic><bold>x</bold></italic> to each of <italic>N</italic> units with activity vector <italic><bold>h</bold></italic>.</p>
<p>The network is fully connected, and matrices have weights given by a certain parametrization of interest. For the example, we considered a normal distribution with zero mean and variance <inline-formula><mml:math id="M6"><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:mfrac></mml:math></inline-formula>.</p>
<p>The network has three layers: the input, the recurrent hidden layer, and the output layer. The readout, in terms of the matrix elements <inline-formula><mml:math id="M7"><mml:msubsup><mml:mrow><mml:mi>W</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mstyle mathvariant="monospace"><mml:mi>o</mml:mi><mml:mi>u</mml:mi><mml:mi>t</mml:mi></mml:mstyle></mml:mrow></mml:msubsup></mml:math></inline-formula>, from <italic>W</italic><sup><italic>out</italic></sup> is described by <xref ref-type="disp-formula" rid="E2">Equation 2</xref>.</p>
<disp-formula id="E2"><label>(2)</label><mml:math id="M8"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mi>z</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:msubsup><mml:mrow><mml:mi>W</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow><mml:mrow><mml:mstyle mathvariant="monospace"><mml:mi>o</mml:mi><mml:mi>u</mml:mi><mml:mi>t</mml:mi></mml:mstyle></mml:mrow></mml:msubsup><mml:msub><mml:mrow><mml:mi>h</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>In terms of the output weight matrix, which in this work is a row vector, it could be written as:</p>
<disp-formula id="E3"><label>(3)</label><mml:math id="M9"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:msup><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mi>W</mml:mi></mml:mstyle></mml:mrow><mml:mrow><mml:mstyle mathvariant="monospace"><mml:mi>o</mml:mi><mml:mi>u</mml:mi><mml:mi>t</mml:mi></mml:mstyle></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msubsup><mml:mrow><mml:mi>W</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mstyle mathvariant="monospace"><mml:mi>o</mml:mi><mml:mi>u</mml:mi><mml:mi>t</mml:mi></mml:mstyle></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mo>&#x022EF;</mml:mo><mml:mspace width="0.3em" class="thinspace"/><mml:mo>,</mml:mo><mml:msubsup><mml:mrow><mml:mi>W</mml:mi></mml:mrow><mml:mrow><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mstyle mathvariant="monospace"><mml:mi>o</mml:mi><mml:mi>u</mml:mi><mml:mi>t</mml:mi></mml:mstyle></mml:mrow></mml:msubsup></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>We considered &#x003C3;() &#x0003D; <italic>tanh</italic>() and &#x003C4; &#x0003D; 1, without loss of generality. The model is discretized using Euler&#x00027;s method following Ingrosso and Abbott (<xref ref-type="bibr" rid="B26">2019</xref>); Bondanelli and Ostojic (<xref ref-type="bibr" rid="B8">2020</xref>); Bi and Zhou (<xref ref-type="bibr" rid="B7">2020</xref>); Jarne (<xref ref-type="bibr" rid="B28">2022</xref>); Jarne and Laje (<xref ref-type="bibr" rid="B30">2023</xref>).</p>
<p>In vector form, the <xref ref-type="disp-formula" rid="E1">Equations 1</xref> and <xref ref-type="disp-formula" rid="E2">2</xref> can be written as:</p>
<disp-formula id="E4"><label>(4)</label><mml:math id="M10"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mfrac><mml:mrow><mml:mi>d</mml:mi><mml:mstyle mathvariant='bold-italic'><mml:mtext>H(t)</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mfrac><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>H</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>&#x003C4;</mml:mi></mml:mrow></mml:mfrac><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003C3;</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msup><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>W</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>Rec</mml:mtext></mml:mstyle></mml:mrow></mml:msup><mml:mstyle mathvariant='bold-italic'><mml:mtext>H</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:msup><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>W</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>in</mml:mtext></mml:mstyle></mml:mrow></mml:msup><mml:mstyle mathvariant='bold-italic'><mml:mtext>X</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>and respectively:</p>
<disp-formula id="E5"><label>(5)</label><mml:math id="M11"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mstyle mathvariant='bold-italic'><mml:mtext>Z(t)</mml:mtext></mml:mstyle><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>W</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>out</mml:mtext></mml:mstyle></mml:mrow></mml:msup><mml:mstyle mathvariant='bold-italic'><mml:mtext>H</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>The system represented by <xref ref-type="disp-formula" rid="E1">Equation 1</xref> is approximated using Euler&#x00027;s method as previously indicated, with a step time &#x003B4;<italic>t</italic>. A value of &#x003C4; &#x0003D; 1 was considered. Then, the dynamics of the discrete-time RNN is given by <xref ref-type="disp-formula" rid="E6">Equation 6</xref></p>
<disp-formula id="E6"><label>(6)</label><mml:math id="M12"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mstyle mathvariant='bold-italic'><mml:mtext>H</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003B4;</mml:mi><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mstyle mathvariant='bold-italic'><mml:mtext>H</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mo>-</mml:mo><mml:mstyle mathvariant='bold-italic'><mml:mtext>H</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:mi>&#x003C3;</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:msup><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>W</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>Rec</mml:mtext></mml:mstyle></mml:mrow></mml:msup><mml:mstyle mathvariant='bold-italic'><mml:mtext>H</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>&#x0002B;</mml:mo><mml:msup><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>W</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mstyle mathvariant='bold-italic'><mml:mtext>in</mml:mtext></mml:mstyle></mml:mrow></mml:msup><mml:mstyle mathvariant='bold-italic'><mml:mtext>X</mml:mtext></mml:mstyle><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>The value considered for the time step is &#x003B4;<italic>t</italic> &#x0003D; 1 to obtain the time evolution. Usually, the amplitude of the activity <italic>H</italic>(<italic>t</italic>) is adimensional or expressed in arbitrary units. It will depend on context. Then, from <xref ref-type="disp-formula" rid="E6">Equation 6</xref>, the activity of the recurrent units at the next time step is given by <xref ref-type="disp-formula" rid="E7">Equation 7</xref>.</p>
<disp-formula id="E7"><label>(7)</label><mml:math id="M13"><mml:mrow><mml:mstyle mathvariant='bold-italic' mathsize='normal'><mml:mi>H</mml:mi></mml:mstyle><mml:mo stretchy='false'>(</mml:mo><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy='false'>)</mml:mo><mml:mo>=</mml:mo><mml:mi>&#x003C3;</mml:mi><mml:mo stretchy='false'>(</mml:mo><mml:msup><mml:mstyle mathvariant='bold-italic' mathsize='normal'><mml:mi>W</mml:mi></mml:mstyle><mml:mrow><mml:mstyle mathvariant='bold-italic' mathsize='normal'><mml:mi>R</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi></mml:mstyle></mml:mrow></mml:msup><mml:mstyle mathvariant='bold-italic' mathsize='normal'><mml:mi>H</mml:mi></mml:mstyle><mml:mo stretchy='false'>(</mml:mo><mml:mi>t</mml:mi><mml:mo stretchy='false'>)</mml:mo><mml:mo>+</mml:mo><mml:msup><mml:mstyle mathvariant='bold-italic' mathsize='normal'><mml:mi>W</mml:mi></mml:mstyle><mml:mrow><mml:mstyle mathvariant='bold-italic' mathsize='normal'><mml:mi>i</mml:mi><mml:mi>n</mml:mi></mml:mstyle></mml:mrow></mml:msup><mml:mstyle mathvariant='bold-italic' mathsize='normal'><mml:mi>X</mml:mi></mml:mstyle><mml:mo stretchy='false'>(</mml:mo><mml:mi>t</mml:mi><mml:mo stretchy='false'>)</mml:mo><mml:mo stretchy='false'>)</mml:mo><mml:mo stretchy='false'>)</mml:mo></mml:mrow></mml:math></disp-formula>
<p>A simple schema of the model is presented in <xref ref-type="fig" rid="F2">Figure 2</xref>. The network have three inputs and three outputs corresponding to the inputs and memory states of the 3-bit Flip Flop task.</p>
<fig id="F2" position="float">
<label>Figure 2</label>
<caption><p>Schema for the RNN described by <xref ref-type="disp-formula" rid="E1">Equations 1</xref> and <xref ref-type="disp-formula" rid="E2">2</xref>. The network has three inputs and outputs to build the different memory states for the 3-bit Flip Flop task.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fnsys-18-1269190-g0002.tif"/>
</fig>
<p>As described in Section 1, the model is implemented in Python using Keras and Tensorflow (Abadi et al., <xref ref-type="bibr" rid="B1">2015</xref>; Chollet et al., <xref ref-type="bibr" rid="B10">2015</xref>). This allows us to use all current algorithms and optimization methods developed and maintained by a massive research community. Tensorflow has a recurrent layer directly implemented to represent <xref ref-type="disp-formula" rid="E7">Equation 7</xref>, where it is possible to choose the initialization of the parameters, number of units and activation function. This is shown in the following code box.</p>
<boxed-text position="float">
<title>Code for a Recurrent layer defined in Tensor Flow.</title>
<preformat>
tf.keras.layers.SimpleRNN(units,&#x000A0;&#x000A0;activation=&#x00022;tanh&#x00022;,
&#x000A0;&#x000A0;&#x000A0;&#x000A0;kernel_initializer=&#x00022;glorot_uniform&#x00022;,
&#x000A0;&#x000A0;&#x000A0;&#x000A0;recurrent_initializer=&#x00022;orthogonal&#x00022;,**kwargs
</preformat>
</boxed-text>
<p>The time scale of the <xref ref-type="disp-formula" rid="E7">Equation 7</xref> is arbitrary. If we are interested, for example, in scales related to cognitive processes, we can consider 1 ms of temporal resolution.</p>
<p>The RNN can be initialized with different weight distributions. Several options can be selected using TensorFlow. This choice will depend, on the one hand, on the existence of some physical motivation or hypothesis of the models. On the other hand, from the ML perspective, it will depend on the performance associated with the considered initialization.</p>
<p>To build an RNN with the topology shown in <xref ref-type="fig" rid="F2">Figure 2</xref>, it is possible to define a sequential model with layers such as:</p>
<boxed-text position="float">
<title>Code for the sequential model defined for the network in <xref ref-type="fig" rid="F2">Figure 2</xref>.</title>
<preformat>
model&#x000A0;=&#x000A0;Sequential()
model.add(SimpleRNN(units=N,&#x000A0;input_shape=(None,3),activation=&#x00022;tanh&#x00022;))
model.add(Dense(units=3,input_dim=N))
</preformat>
</boxed-text>
<p>Where <monospace>input_shape &#x0003D; (None, 3)</monospace> means the shape of the input vector, <monospace>activation &#x0003D; &#x00027;tanh&#x00027;</monospace> corresponds to the definition of activation function, and <monospace>Dense</monospace> is a fully connected output layer. In this way, we completed the first step which is of the model definition in terms of the code. Orher acivation funcions are avaliable at <ext-link ext-link-type="uri" xlink:href="https://www.tensorflow.org/api_docs/python/tf/keras/activations">https://www.tensorflow.org/api_docs/python/tf/keras/activations</ext-link>.</p>
<p>Other network architectures, such as Gated Recurrent Units (Chung et al. (<xref ref-type="bibr" rid="B11">2014</xref>)) or Long Short Term Memories (SHI et al., <xref ref-type="bibr" rid="B52">2015</xref>), could be selected if there was any motivation from the perspective of the mechanisms to take into account. Both are already implemented in TensorFlow. Such code options are shown in the boxes below.</p>
<boxed-text position="float">
<title>Code using other architecture (GRU) for the sequential model defined for <xref ref-type="fig" rid="F2">Figure 2</xref>.</title>
<preformat>
model&#x000A0;=&#x000A0;Sequential()
model.add(layers.GRU(units=N,&#x000A0;return_sequences=True))
...
</preformat>
</boxed-text>
<boxed-text position="float">
<title>Code using other architecture (LSTM) for the sequential model defined for <xref ref-type="fig" rid="F2">Figure 2</xref>.</title>
<preformat>
model&#x000A0;=&#x000A0;Sequential()
model.add(layers.LSTM(units=N,&#x000A0;input_shape=(None,3)))
...
</preformat>
</boxed-text>
<p>The choice of the appropriate architecture will depend on the system to be modeled. Particular features, such as bias terms, can be also considered. In some cases, it is possible, to build architectures with additional features that are not pre-defined. This can be done by using the class structures in the framework.</p>
<p>For example, it is possible to define your own RNN cell layer (the inner part of the for loop) with custom behavior and use it with the generic <monospace>keras.layers.RNN</monospace> layer (the for loop itself). For more details see: <ext-link ext-link-type="uri" xlink:href="https://www.tensorflow.org/guide/keras/working_with_rnns">https://www.tensorflow.org/guide/keras/working_with_rnns</ext-link>.</p></sec>
<sec id="s3">
<title>3 Task selection and parametrization</title>
<p>The parameterization of the task will have strong consequences on the possible dynamics obtained from the system through network training (Jarne and Laje, <xref ref-type="bibr" rid="B30">2023</xref>). Possible examples are considering training with noise vs. without noise. Another is to consider amplitude variations or pulses of variable width in the training set.</p>
<p>Previous works have considered some relevant tasks in Computational Neuroscience related to decision-making or working memory. For example in Jarne (<xref ref-type="bibr" rid="B27">2021</xref>, <xref ref-type="bibr" rid="B28">2022</xref>); Jarne and Laje (<xref ref-type="bibr" rid="B30">2023</xref>). All these processes use time-varying signals, which are very different from the binary boolean operations considered with forward networks. There are other examples of widespread tasks also considered in Computational Neuroscience, such as &#x0201C;Perceptual Decision Making&#x0201D; (Britten et al., <xref ref-type="bibr" rid="B9">1992</xref>) or &#x0201C;Context-dependent Decision Making&#x0201D; (Mante et al., <xref ref-type="bibr" rid="B39">2013</xref>). Each task has different possible parameterizations. In particular, the task defined in Mante et al. (<xref ref-type="bibr" rid="B39">2013</xref>) has recently been used to study the cortex response (Zhang et al., <xref ref-type="bibr" rid="B67">2021</xref>).</p>
<p>It is also possible to consider working memory tasks such as &#x0201C;Delay match to sample with two items&#x0201D; (Freedman and Assad, <xref ref-type="bibr" rid="B19">2006</xref>) or &#x0201C;Parametric working memory&#x0201D; (Roitman and Shadlen, <xref ref-type="bibr" rid="B51">2002</xref>). For present work, motivated by Sussillo and Barak (<xref ref-type="bibr" rid="B57">2013</xref>), a working memory task, a 3-bit Flip Flop was chosen.</p>
<p>A Flip Flop is a binary task designed to store one bit of information. It has two inputs, Set (S) and Reset (R), which in our case will be represented by the temporal signal states &#x0002B;1 and -1 in amplitude, and one output Q. The output represents the current state of the Flip Flop and can be either 1 or -1. The operation is based on the following rule: If the input is 1, the Flip Flop output is set to the &#x0201C;1&#x0201D; state. If input is -1, the Flip Flop output is reset to the &#x0201C;-1&#x0201D; state. If both inputs are 0, the Flip Flop remains in its current state.</p>
<p>Once the task is chosen, the requirements must be translated into an algorithm that allows us to generate the training set. To parameterize the task, the following criteria were applied here:</p>
<list list-type="bullet">
<list-item><p>The possible states of the Flip Flop are represented in such a way that a positive pulse represents a set and a negative pulse represents a reset.</p></list-item>
<list-item><p>The state of the output will change corresponding to the input command.</p></list-item>
<list-item><p>A certain delay in the response was considered after the falling edge of the input signal.</p></list-item>
</list>
<p>The training data set consists of time series with pulses of fixed duration that represent set and reset signals. Those signals can be activated randomly and are separated by a random time interval. In all time series, a certain noise level has been added to the input. Each input elicitate a target output according to the Flip Flop rule: if we have a set signal or positive pulse, the output is in a high state. If we have a reset signal or negative pulse, output is in a low state. Otherwise, the output remains in the previous state.</p>
<p>The number of inputs in the network corresponds to the number of memory states that can be stored. A Flip Flop is a one-bit memory, meaning that two states only can be stored. In this way, we have registers formed by three Flip Flops (a 3-bit memory), which means that we have 8 different memory states.</p>
<p>To complete the full training data set, it is necessary to generate tensors of size <monospace>sample_size</monospace> with the input time series of length <monospace>time_series_lengh</monospace> for each of the three inputs and outputs. To do that efficiently, we used Numpy arrays (Harris et al., <xref ref-type="bibr" rid="B23">2020</xref>). In the present work, we provide the code to generate a Flip Flop data set. Three random components of the set <monospace>x_train-y_train</monospace> are shown in <xref ref-type="fig" rid="F3">Figure 3</xref>. Input has amplitude noise of 10%. The target output, <monospace>y_train</monospace>, was simulated with a time delay answer of 20 ms. Each row (and color) corresponds to one of the inputs, and each column to a different sample. Each training sample consists of a Numpy array (Harris et al., <xref ref-type="bibr" rid="B23">2020</xref>). This is shown in the following code box.</p>
<boxed-text position="float">
<title>Training data set pairs defined as Numpy arrays.</title>
<preformat>
x_train[sample_size,time_series_lengh,3]
y_train[sample_size,time_series_lengh,3]
</preformat>
</boxed-text>
<fig id="F3" position="float">
<label>Figure 3</label>
<caption><p>Three random samples of the training data set for each input channel. Each row (and color) corresponds to one of the inputs. Each column corresponds to a different sample. The gray line in each case represents the target output.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fnsys-18-1269190-g0003.tif"/>
</fig>
</sec>
<sec id="s4">
<title>4 Training protocol and parameter selection</title>
<p>Training methods for neural networks can be unsupervised or supervised. We focused on applying a supervised method.</p>
<p>Different approaches are available, but those in which a particular type of gradient descent method is applied stand out in the literature. An example is the paradigm of Reservoir Computing, specifically the use of liquid (or echo-state networks) (Maass et al., <xref ref-type="bibr" rid="B38">2002</xref>), where the modifications of the network weights are made only in the weights of the output layer, <italic>W</italic><sup><italic>out</italic></sup>.</p>
<p>Other outstanding approaches were developed by Sussillo and Abbot. They have developed a method called FORCE that allows the reproduction of complex output patterns, including human motion-captured data (Sussillo and Abbott (<xref ref-type="bibr" rid="B56">2009</xref>)). Modifications to the algorithm have also been applied successfully in various applications (DePasquale et al., <xref ref-type="bibr" rid="B15">2018</xref>; Ingrosso and Abbott, <xref ref-type="bibr" rid="B26">2019</xref>; Engelken et al., <xref ref-type="bibr" rid="B17">2022</xref>).</p>
<p>The other method used for estimation of the gradient in RNNs is called Backpropagation Through Time (BPTT), and then an optimization method for minimizing the gradient. Given the recent advances in the implementation of this method with the open-source libraries previously mentioned, this is the method used here. Other back propagation-based methods have been published more recently. For example, in Khan et al. (<xref ref-type="bibr" rid="B32">2018</xref>), authors proposed to use fractional calculus to improve the conventional BPTT.</p>
<p>In this work, supervised learning was used, with standard backpropagation through time. An Adaptive Stochastic Gradient Descent training method provided by the Keras framework (Kingma and Ba, <xref ref-type="bibr" rid="B34">2014</xref>) was applied.</p>
<p>First, recurrent weights were initialized using a random normal distribution with the orthogonal condition on the matrix. During training, noisy square pulse signals were used as the inputs, as the examples shown in <xref ref-type="fig" rid="F3">Figure 3</xref>, and described in Section 3. In this way, sets of time series with 350 time points were generated containing random positive and negative pulses, with their corresponding output according to the operating rule described for the Flip Flop.</p>
<p>The appropriate loss function to train the model is the mean square error between the target function and the output of the network. It is defined as:</p>
<disp-formula id="E8"><label>(8)</label><mml:math id="M14"><mml:mtable class="eqnarray" columnalign="left"><mml:mtr><mml:mtd><mml:mi>E</mml:mi><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:mfrac><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>M</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:mstyle displaystyle="true"><mml:munderover accentunder="false" accent="false"><mml:mrow><mml:mo>&#x02211;</mml:mo></mml:mrow><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>L</mml:mi></mml:mrow></mml:munderover></mml:mstyle><mml:mo>|</mml:mo><mml:msub><mml:mrow><mml:mstyle mathvariant='bold'><mml:mtext>Z</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mstyle mathvariant='bold'><mml:mtext>j</mml:mtext></mml:mstyle></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo>-</mml:mo><mml:msubsup><mml:mrow><mml:mstyle mathvariant='bold'><mml:mtext>Z</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mstyle mathvariant='bold'><mml:mtext>j</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mstyle mathvariant='bold'><mml:mtext>target</mml:mtext></mml:mstyle></mml:mrow></mml:msubsup><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:msup><mml:mrow><mml:mo>|</mml:mo></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup><mml:mo>,</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<p>where <inline-formula><mml:math id="M15"><mml:msubsup><mml:mrow><mml:mstyle class="text"><mml:mtext mathvariant="bold">Z</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mstyle class="text"><mml:mtext mathvariant="bold">j</mml:mtext></mml:mstyle></mml:mrow><mml:mrow><mml:mstyle class="text"><mml:mtext mathvariant="bold">target</mml:mtext></mml:mstyle></mml:mrow></mml:msubsup><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula> is the desired target function and <bold>Z</bold><sub><bold>j</bold></sub>(<italic>t</italic>) is the actual output.</p>
<p>The training set consisted of more than 15000 different random samples. The previously mentioned training procedures correspond, in terms of the code structure, to the methods for compiling and fitting models. The loss function and the optimizer algorithm are chosen in the compiling step. Different information about the training data set, epochs, and other training characteristics can be specified with the fitting method. An example of implementation is shown in the following code box.</p>
<boxed-text position="float">
<title>Code for the compiling and training steps.</title>
<preformat>&#x000A0;
model.compile(loss&#x000A0;=&#x000A0;&#x00022;mse&#x00022;,&#x000A0;optimizer=ADAM)
model.fit(x_train[50:sample_size,:,:],&#x000A0;y_train[50:sample_size,:,:],
&#x000A0;epochs=epochs,&#x000A0;batch_size=128,&#x000A0;shuffle=True)
&#x000A0;</preformat>
</boxed-text>
<p>The main parameters of a neural network are the weights of the connections. These parameters are learned during the training stage. On the other hand, hyperparameters are parameters of your neural network that can not be learned via gradient descent or some other training method. These include the learning rate, number of layers, or the number of neurons in a given layer.</p>
<p>Tuning the hyperparameters means the process of choosing the best values of them. Typically, this is done by evaluating the performance of the network on a validation set. Then, we have to change the hyperparameters and re-evaluate the model, choosing the values that give the best performance on the validation set. Another approach for choosing them is to have an informed decision or hypothesis related to the physics or nature of the system under study.</p>
<p>How do we choose these values? Often, there is good standard initialization related to each particular task of interest. An example of the criteria is provided for the Flip Flop task in <xref ref-type="table" rid="T1">Table 1</xref>.</p>
<table-wrap position="float" id="T1">
<label>Table 1</label>
<caption><p>Model&#x00027;s parameters and criteria for the network&#x00027;s implementation and training.</p></caption>
<table frame="box" rules="all">
<thead>
<tr style="background-color:#919498;color:#ffffff">
<th valign="top" align="left"><bold>Parameter/criteria</bold></th>
<th valign="top" align="left"><bold>Value</bold></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left">Units</td>
<td valign="top" align="left">400</td>
</tr>
 <tr>
<td valign="top" align="left">Time step</td>
<td valign="top" align="left">1</td>
</tr>
 <tr>
<td valign="top" align="left">Input Weight</td>
<td valign="top" align="left">3 &#x000D7; 400</td>
</tr>
 <tr>
<td valign="top" align="left">Recurrent Weights</td>
<td valign="top" align="left">400 &#x000D7; 400</td>
</tr>
 <tr>
<td valign="top" align="left">Output Weight</td>
<td valign="top" align="left">400 &#x000D7; 3</td>
</tr>
 <tr>
<td valign="top" align="left">Training algorithm</td>
<td valign="top" align="left">BPTT ADAM</td>
</tr>
 <tr>
<td valign="top" align="left">Initialization</td>
<td valign="top" align="left">Random Orthogonal</td>
</tr>
<tr>
<td valign="top" align="left">Regularization</td>
<td valign="top" align="left">None</td>
</tr></tbody>
</table>
</table-wrap>
<p>Another aspect to consider is the regularization of the model. Regularization refers to training our model well enough that it can generalize over data it hasn&#x00027;t seen before.</p>
<p>To summarize, in the training stage, the main aspects we have to consider are the size of the network, data set, noise, and regularization terms that are appropriate for the considered task.</p>
<p>A good practice is to build a set of RNNs (at least a dozen) with different hyperparameters that are correctly trained to perform the same task and that can serve as a test set and allow us to compare the variations in the possible solutions.</p></sec>
<sec id="s5">
<title>5 Analyzing the results</title>
<p>The results obtained after training the RNN can be analyzed in several ways. On the one hand, we can consider the quality of the solutions obtained (and the robustness) by analyzing the predicted output concerning the target and stability against noise conditions. On the other hand, we can study the solutions in terms of the dynamics and collective behavior. In Section 5.1, we will first briefly discuss how to evaluate robustness in terms of the output obtained and how robust it can be against variations in the input stimuli. Then, in Section 5.2, we will discuss in-depth details of the dynamics and collective behavior.</p>
<sec>
<title>5.1 Evaluating RNN performance and robustness</title>
<p>We can measure the rate of success for a set of networks in terms of Euclidean distance between target and output (Jarne and Laje, <xref ref-type="bibr" rid="B30">2023</xref>). The distance between the network&#x00027;s predicted output and the target output could be estimated using the Numpy function <monospace>linalg.norm()</monospace>, which in this case is the Frobenius norm (or Euclidean norm) between the output vector of the trained network and the target output. We could use other metrics, such as Mean squared error (MSE), which measures the average squared difference between predicted and actual values.</p>
<boxed-text position="float">
<title>How to use linear algebra library from Numpy to calculate the norm of the vector &#x0201C;Difference&#x0201D; using the Euclidean norm.</title>
<preformat>
from&#x000A0;numpy&#x000A0;import&#x000A0;linalg&#x000A0;as&#x000A0;LA
euclidean_norm&#x000A0;=&#x000A0;LA.norm(Difference)
</preformat>
</boxed-text>
<p>We can also include noise and variations in amplitude to the data and find constraints on how the network is still able to accurately predict the target.</p>
<p>In addition to the metrics mentioned above, we can also evaluate the robustness using other available Accuracy metrics.</p>
<p>In general, what type of data sets we use to train the network is directly related to how robust we want to design our systems and what properties we are seeking to represent and should be taken into account when comparing the abstract models studied here with those obtained from experimental data.</p>
<p>Characterizing the limitations of the network concerning variations in input signals is a good practice that will allow us to better understand the results obtained.</p>
<p>Another analysis related to robustness that can be performed is to determine the minimum size of the network that allows the parameterized task to be performed (in our example Flip Flop), given a certain desired accuracy.</p>
</sec>
<sec>
<title>5.2 Analyzing the collective behavior of trained RNNs: visualization and dimensionality reduction techniques</title>
<p>After training, we obtained a set of RNNs that can perform the tasks of interest. We describe in this section the different aspects to analyze regarding the network&#x00027;s collective behavior. We selected a method for the model&#x00027;s visualization and a group of tools to extract the relevant information.</p>
<p>For example, it is possible to visualize the connectivity matrix (recurrent weight matrix), as it is shown on the left side of <xref ref-type="fig" rid="F4">Figure 4</xref>. The columns represent the output connection of the i-neuron, and the rows are the input connection. They are also called post-synaptic and pre-synaptic. The color bar on the right side represents the intensity of the connections. We have to consider an appropriate scale for the visualization. Even so, it may not be entirely clear how to observe the relevant information, apart from the fact that, after training, most of the weights remain close to zero. As a first approach for visualization, a plot of the connectivity matrix could be useful, even if the case presented here does not reveal relevant information. It&#x00027;s important not to undervalue it. If the connectivity has some structure farther from a random distribution, it will be observed in the connectivity plot. For example, having null autoconnection terms will be reflected in the color of the diagonal terms of the matrix plot. Another example could be sparsity, which would be reflected in patches over the matrix. Or perhaps, in the case of having excitatory and inhibitory units, it would be easy to visualize the different columns corresponding to the same sign of out connection. In case of imposing such constraints on the connections, as Dales&#x00027; Law (Dale, <xref ref-type="bibr" rid="B13">1935</xref>), or any particular constraint, they will be visible in this stage, and this representation will be more useful.</p>
<fig id="F4" position="float">
<label>Figure 4</label>
<caption><p><bold>Left</bold>: Example of visualization for the connectivity matrix for a trained RNN. <bold>Right</bold>: Eigenvalue distribution of <bold><italic>W</italic><sup><italic>rec</italic></sup></bold> in the complex plane.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fnsys-18-1269190-g0004.tif"/>
</fig>
<p>If we don&#x02018;t obtain relevant information with this first visualization, we know that useful information could be still encoded in the connectivity matrix, but it may not be immediately distinguishable with a connectivity plot. There are different transformations or analyses that we can perform on the recurrent weight matrix with this aim. Different Linear Algebra operations are available in the Numpy Library (Harris et al., <xref ref-type="bibr" rid="B23">2020</xref>) that are optimized to be used with the array structures. For example, if we perform a decomposition of <italic>W</italic><sup><italic>rec</italic></sup> in their eigenvectors and eigenvalues, we can obtain the eigenvalue distribution as it is shown in the right side of <xref ref-type="fig" rid="F4">Figure 4</xref>. This analysis can be done using the code in the following code box.</p>
<boxed-text position="float">
<title>How to use linear algebra library from Numpy for eigenvalue decomposition.</title>
<preformat>
from&#x000A0;numpy&#x000A0;import&#x000A0;linalg&#x000A0;as&#x000A0;LA
eigenvalues,&#x000A0;eigenvectors=&#x000A0;LA.eig(Matrix)
</preformat>
</boxed-text>
<p>During training, the matrix associated with the network tends to be non-normal, which results in their eigenvalues lying closer to the unit circle. This behavior is explained in more detail in papers that study the dynamics of RNNs, where it is shown that the presence of recurrent connections and the attractors in the network&#x00027;s dynamics can cause this accumulation of eigenvalues close to the unit circle (Asllani et al., <xref ref-type="bibr" rid="B3">2018</xref>; Bondanelli and Ostojic, <xref ref-type="bibr" rid="B8">2020</xref>; Jarne, <xref ref-type="bibr" rid="B28">2022</xref>).</p>
<p>Additionally, in these studies, it is typically shown that this accumulation of eigenvalues on the unit circle leads to slowing down the dynamics of the network. They can be linked to the emergence of long-term memories related to the linearization of the system. Therefore, this behavior can be understood as a necessary condition for the network to effectively store and retrieve information over longer time scales.</p>
<p>In the case presented here, we can visualize that, except for a small group of eigenvalues that migrated out of the unit circle, the rest remain on it, which is related to the initial orthogonal condition. The same was replicated throughout all simulations. A set of four examples is shown in <xref ref-type="fig" rid="F5">Figure 5</xref>, and the code provided allows us to reproduce more. Eigenvalues outside the unitary circle seem to be related to the behavior (or modes) observed for the different stimuli at the input as described in (Jarne, <xref ref-type="bibr" rid="B28">2022</xref>). This is relevant in terms of the dynamics. Additional information related to the connectivity matrix could also be obtained (Jarne, <xref ref-type="bibr" rid="B28">2022</xref>).</p>
<fig id="F5" position="float">
<label>Figure 5</label>
<caption><p>Four different examples of eigenvalue distributions of <italic>W</italic><sup><italic>rec</italic></sup> for trained RNNs which have been initialized before with an orthogonal distribution.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fnsys-18-1269190-g0005.tif"/>
</fig>
<p>Other possible studies that we can perform are related to the response in terms of the activity of the network units when applying the different stimuli.</p>
<p>Since we have a large number of units, and for each, an activity vector, dimensionally reduction methods are appropriate to analyze such behavior. They have been used widely in different works related to large-scale neural recordings (Cunningham and Yu, <xref ref-type="bibr" rid="B12">2014</xref>; Williams et al., <xref ref-type="bibr" rid="B60">2018</xref>).</p>
<p>Scikit-learn (Pedregosa et al., <xref ref-type="bibr" rid="B48">2011</xref>) is a Python open-source library based on Numpy that allows us to perform dimensionality reduction, feature extraction, and normalization, among others. It has efficient methods for predictive data analysis. A possible decomposition could be, for example, Principal Component Analysis (PCA) or also Single Value Decomposition (SVD). The following code box shows how to call the library&#x00027;s functions.</p>
<boxed-text position="float">
<title>How to import scikit learn libraries to perform single value decomposition and principal component analysis.</title>
<preformat>
from&#x000A0;sklearn.decomposition&#x000A0;import&#x000A0;PCA
from&#x000A0;sklearn.decomposition&#x000A0;import&#x000A0;TruncatedSVD
</preformat>
</boxed-text>
<p>These tools can be used to extract relevant features of the system. For this work, the behavior, in terms of the activity of the units, was analyzed.</p>
<p>It is well known that the different memory states in a 3-bit memory are distributed in the vertex of a cube-like form in the space state (Sussillo and Barak, <xref ref-type="bibr" rid="B57">2013</xref>). This was shown when authors explored the hypothesis that fixed points, both stable and unstable, and the linearized dynamics around them, can reveal aspects of how RNNs implement their computations.</p>
<p>A data set was built for testing and reproducing the behavior. It generates eight different memory states, as shown on the left side of <xref ref-type="fig" rid="F6">Figure 6</xref>, where each panel shows the input and output of the network. Time series of 600 ms were considered to generate all the different memory states of the 3-bit memory by choosing the correct commutation for the inputs in fixed time intervals. Output responses are shown in red in the figure.</p>
<fig id="F6" position="float">
<label>Figure 6</label>
<caption><p><bold>(A)</bold> Data set for testing. Each panel corresponds to one input and the predicted output of the Flip Flop, which is shown in red. <bold>(B)</bold> Schema of the network. <bold>(C)</bold> Single Value Decomposition applied to the activity vector <bold>H</bold>(<italic>t</italic>) of panel b) in the three components of greatest variance. Each color point corresponds to a different memory state.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fnsys-18-1269190-g0006.tif"/>
</fig>
<p>The testing set is injected into the network (right upper panel of the figure), and then the activity of the units is analyzed by applying SVD on the activity vector <italic>H</italic>(<italic>t</italic>). The behavior of the system was represented in the three axes of the greatest variance. The bottom right part of <xref ref-type="fig" rid="F6">Figure 6</xref> shows the activity in the reduced state space (3-dimensional). Each vertex corresponds to each memory state marked in different colors.</p>
<p>It is well known that different variations of the realizations, in terms of weight distribution and dynamical behavior, are possible when training networks for the same task (Jarne, <xref ref-type="bibr" rid="B27">2021</xref>, <xref ref-type="bibr" rid="B28">2022</xref>; Jarne and Laje, <xref ref-type="bibr" rid="B30">2023</xref>). This was exemplified in <xref ref-type="fig" rid="F5">Figure 5</xref> and is also shown in <xref ref-type="fig" rid="F7">Figure 7</xref>, where the four different realizations of the trained networks of <xref ref-type="fig" rid="F5">Figure 5</xref> were elicited with the same testing data set and a decomposition SVD analysis, was performed.</p>
<fig id="F7" position="float">
<label>Figure 7</label>
<caption><p>Activity of the four different realizations of RNNs trained for the same 3-bit Flip Flop task in the dimensionally reduced space. Configurations are similar to one presented in <xref ref-type="fig" rid="F5">Figure 5</xref>.</p></caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fnsys-18-1269190-g0007.tif"/>
</fig>
<p>The vertices in this space of the main components are distributed in different positions. A cube-like structure always appears, similarly to what was observed in Sussillo and Barak (<xref ref-type="bibr" rid="B57">2013</xref>), and is rotated in different spatial directions for different realizations. It is possible to study and classify the behavior of the obtained systems by comparing the network obtained. This cube-like structure is characteristic of this task parametrization, and it appears even when we used a different training method and network parameters compared with previous studies (Sussillo and Barak, <xref ref-type="bibr" rid="B57">2013</xref>).</p>
<p>Additional analysis could be considered depending on the aspects of interest to be studied. Here, a minimal analysis was proposed. We described in detail the steps, visualization tool, criteria, and implementation. The code for training and analysis is provided also in an open repository: <ext-link ext-link-type="uri" xlink:href="https://github.com/katejarne/3-bit-FF-tutorial/tree/main/paper">https://github.com/katejarne/3-bit-FF-tutorial/tree/main/paper</ext-link>. It can be also used as an open framework to parametrize different tasks or additional studies. In this way, we can generate and compare the different realizations for the Flip Flop task or define different tasks for study.</p></sec>
</sec>
<sec sec-type="conclusions" id="s6">
<title>6 Conclusions</title>
<p>In this work, all steps to build and analyze an RNN have been presented for a sample task. We started from the model description in terms of the equations, discretization, and code implementation. We discussed different options that are available for code implementation depending on the considered model and scientific questions. Then, we described the task parametrization and network training protocol. We also presented a set of tools to analyze the results using open-source scientific libraries making use of the different visualization tools that allow extracting relevant features.</p>
<p>We used the Flip Flop task as an example, but other relevant tasks could be considered, as mentioned in Section 3. For example, &#x0201C;Perceptual Decision Making&#x0201D; (Britten et al., <xref ref-type="bibr" rid="B9">1992</xref>), &#x0201C;Context-dependent Decision Making&#x0201D; (Mante et al., <xref ref-type="bibr" rid="B39">2013</xref>; Zhang et al., <xref ref-type="bibr" rid="B67">2021</xref>), working memory tasks such as &#x0201C;Delay match to sample with two items&#x0201D; (Freedman and Assad, <xref ref-type="bibr" rid="B19">2006</xref>) or &#x0201C;Parametric working memory&#x0201D; (Roitman and Shadlen, <xref ref-type="bibr" rid="B51">2002</xref>). In this work, motivated by Sussillo and Barak (<xref ref-type="bibr" rid="B57">2013</xref>), a working memory task such as a 3-bit Flip Flop, was chosen to show the entire process: from the differential equations of the RNN model, discretization, through the parameterization of the task and the methods of analysis for the activity of the network against the different stimuli on the network.</p>
<p>The use of open-source scientific frameworks designed and maintained for large communities, such as the tools used here, allows enhancing research. This is why we are currently using tools that are more transparent in terms of code and documentation because they are open to being modified and improved by thousands of users.</p>
<p>Regarding the limitations, the proposed method was evaluated on a single cognitive task, namely Flip Flop. It is not clear whether the proposed pipeline would generalize to other more complex types of cognitive tasks. We did not include other explicit biological constraints in this example. We could extend it to include sparsity or Dale&#x00027;s law, for example. Further work could address such research directions to complement generalization and biological details.</p></sec>
<sec sec-type="data-availability" id="s7">
<title>Data availability statement</title>
<p>The datasets presented in this study can be found and also created using the online repository: <ext-link ext-link-type="uri" xlink:href="https://github.com/katejarne/3-bit-FF-tutorial">https://github.com/katejarne/3-bit-FF-tutorial</ext-link>.</p></sec>
<sec sec-type="author-contributions" id="s8">
<title>Author contributions</title>
<p>CJ: Conceptualization, Formal analysis, Investigation, Methodology, Resources, Software, Validation, Visualization, Writing &#x02013; original draft, Writing &#x02013; review &#x00026; editing.</p></sec>
</body>
<back>
<sec sec-type="funding-information" id="s9">
<title>Funding</title>
<p>The author(s) declare that financial support was received for the research, authorship, and/or publication of this article. Author acknowledges support from PICT 2020-01413.</p>
</sec>
<sec sec-type="COI-statement" id="conf1">
<title>Conflict of interest</title>
<p>The author declares that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
<sec sec-type="disclaimer" id="s10">
<title>Publisher&#x00027;s note</title>
<p>All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.</p>
</sec>
<ref-list>
<title>References</title>
<ref id="B1">
<citation citation-type="web"><person-group person-group-type="author"><name><surname>Abadi</surname> <given-names>M.</given-names></name> <name><surname>Agarwal</surname> <given-names>A.</given-names></name> <name><surname>Barham</surname> <given-names>P.</given-names></name> <name><surname>Brevdo</surname> <given-names>E.</given-names></name> <name><surname>Chen</surname> <given-names>Z.</given-names></name> <name><surname>Citro</surname> <given-names>C.</given-names></name> <etal/></person-group>. (<year>2015</year>). <source>TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems</source>. Available online at: <ext-link ext-link-type="uri" xlink:href="http://tensorflow.org">tensorflow.org</ext-link> (accessed March 19, 2024).</citation>
</ref>
<ref id="B2">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Alianna</surname> <given-names>J</given-names></name> <name><surname>Maren</surname> <given-names>C. T. H.</given-names></name> <name><surname>Pap</surname> <given-names>R. M.</given-names></name></person-group> (<year>1990</year>). <source>Handbook of Neural Computing Applications</source>. <publisher-loc>Cambridge</publisher-loc>: <publisher-name>Elsevier Inc, Academic Press</publisher-name>.</citation>
</ref>
<ref id="B3">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Asllani</surname> <given-names>M.</given-names></name> <name><surname>Lambiotte</surname> <given-names>R.</given-names></name> <name><surname>Carletti</surname> <given-names>T.</given-names></name></person-group> (<year>2018</year>). <article-title>Structure and dynamical behavior of non-normal networks</article-title>. <source>Sci. Adv</source>. 4, eaau9403. <pub-id pub-id-type="doi">10.1126/sciadv.aau9403</pub-id><pub-id pub-id-type="pmid">30547090</pub-id></citation></ref>
<ref id="B4">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Baldassarro</surname> <given-names>V. A.</given-names></name> <name><surname>Cescatti</surname> <given-names>M.</given-names></name> <name><surname>Rocco</surname> <given-names>M. L.</given-names></name> <name><surname>Aloe</surname> <given-names>L.</given-names></name> <name><surname>Lorenzini</surname> <given-names>L.</given-names></name> <name><surname>Giardino</surname> <given-names>L.</given-names></name> <etal/></person-group>. (<year>2023</year>). <article-title>Nerve growth factor promotes differentiation and protects the oligodendrocyte precursor cells from <italic>in vitro</italic> hypoxia/ischemia</article-title>. <source>Front. Neurosci</source>. 17, 1111170. <pub-id pub-id-type="doi">10.3389/fnins.2023.1111170</pub-id><pub-id pub-id-type="pmid">36875668</pub-id></citation></ref>
<ref id="B5">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Barak</surname> <given-names>O.</given-names></name></person-group> (<year>2017</year>). <article-title>Recurrent neural networks as versatile tools of neuroscience research</article-title>. <source>Curr. Opini. Neurobiol.</source> <volume>46</volume>, <fpage>1</fpage>&#x02013;<lpage>6</lpage>. Computational Neuroscience. <pub-id pub-id-type="doi">10.1016/j.conb.2017.06.003</pub-id><pub-id pub-id-type="pmid">28668365</pub-id></citation></ref>
<ref id="B6">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bengio</surname> <given-names>Y.</given-names></name> <name><surname>Simard</surname> <given-names>P.</given-names></name> <name><surname>Frasconi</surname> <given-names>P.</given-names></name></person-group> (<year>1994</year>). <article-title>Learning long-term dependencies with gradient descent is difficult</article-title>. <source>IEEE Trans. Neural Netw</source>. <volume>5</volume>, <fpage>157</fpage>&#x02013;<lpage>166</lpage>. <pub-id pub-id-type="doi">10.1109/72.279181</pub-id><pub-id pub-id-type="pmid">18267787</pub-id></citation></ref>
<ref id="B7">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bi</surname> <given-names>Z.</given-names></name> <name><surname>Zhou</surname> <given-names>C.</given-names></name></person-group> (<year>2020</year>). <article-title>Understanding the computation of time using neural network models</article-title>. <source>Proc. Nat. Acad. Sci</source>. <volume>117</volume>, <fpage>10530</fpage>&#x02013;<lpage>10540</lpage>. <pub-id pub-id-type="doi">10.1073/pnas.1921609117</pub-id><pub-id pub-id-type="pmid">32341153</pub-id></citation></ref>
<ref id="B8">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bondanelli</surname> <given-names>G.</given-names></name> <name><surname>Ostojic</surname> <given-names>S.</given-names></name></person-group> (<year>2020</year>). <article-title>Coding with transient trajectories in recurrent neural networks</article-title>. <source>PLoS Comput. Biol</source>. <volume>16</volume>, <fpage>1</fpage>&#x02013;<lpage>36</lpage>. <pub-id pub-id-type="doi">10.1371/journal.pcbi.1007655</pub-id><pub-id pub-id-type="pmid">32053594</pub-id></citation></ref>
<ref id="B9">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Britten</surname> <given-names>K.</given-names></name> <name><surname>Shadlen</surname> <given-names>M.</given-names></name> <name><surname>Newsome</surname> <given-names>W.</given-names></name> <name><surname>Movshon</surname> <given-names>J.</given-names></name></person-group> (<year>1992</year>). <article-title>The analysis of visual motion: a comparison of neuronal and psychophysical performance</article-title>. <source>J. Neurosci</source>. <volume>12</volume>, <fpage>4745</fpage>&#x02013;<lpage>4765</lpage>. <pub-id pub-id-type="doi">10.1523/JNEUROSCI.12-12-04745.1992</pub-id><pub-id pub-id-type="pmid">1464765</pub-id></citation></ref>
<ref id="B10">
<citation citation-type="web"><person-group person-group-type="author"><name><surname>Chollet</surname> <given-names>F.</given-names></name></person-group> (<year>2015</year>). <source>Keras</source>. Available online at: <ext-link ext-link-type="uri" xlink:href="http://citebay.com/how-to-cite/keras/">http://citebay.com/how-to-cite/keras/</ext-link> (accessed March 19, 2024).</citation>
</ref>
<ref id="B11">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Chung</surname> <given-names>J.</given-names></name> <name><surname>Gulcehre</surname> <given-names>C.</given-names></name> <name><surname>Cho</surname> <given-names>K.</given-names></name> <name><surname>Bengio</surname> <given-names>Y.</given-names></name></person-group> (<year>2014</year>). <article-title>&#x0201C;Empirical evaluation of gated recurrent neural networks on sequence modeling,&#x0201D;</article-title> in <source>NIPS 2014 Workshop on Deep Learning, December 2014</source>.</citation>
</ref>
<ref id="B12">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Cunningham</surname> <given-names>J. P.</given-names></name> <name><surname>Yu</surname> <given-names>B. M.</given-names></name></person-group> (<year>2014</year>). <article-title>Dimensionality reduction for large-scale neural recordings</article-title>. <source>Nat. Neurosci</source>. <volume>17</volume>, <fpage>1500</fpage>&#x02013;<lpage>1509</lpage>. <pub-id pub-id-type="doi">10.1038/nn.3776</pub-id><pub-id pub-id-type="pmid">25151264</pub-id></citation></ref>
<ref id="B13">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Dale</surname> <given-names>H.</given-names></name></person-group> (<year>1935</year>). <article-title>Pharmacology and nerve-endings</article-title>. <source>Proc. R. Soc. Med</source>. <volume>28</volume>, <fpage>319</fpage>&#x02013;<lpage>332</lpage>. <pub-id pub-id-type="doi">10.1177/003591573502800330</pub-id></citation>
</ref>
<ref id="B14">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Deng</surname> <given-names>J.</given-names></name></person-group> (<year>2013</year>). <article-title>Dynamic neural networks with hybrid structures for nonlinear system identification</article-title>. <source>Eng. Appl. Artif. Intell</source>. <volume>26</volume>, <fpage>281</fpage>&#x02013;<lpage>292</lpage>. <pub-id pub-id-type="doi">10.1016/j.engappai.2012.05.003</pub-id></citation>
</ref>
<ref id="B15">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>DePasquale</surname> <given-names>B.</given-names></name> <name><surname>Cueva</surname> <given-names>C. J.</given-names></name> <name><surname>Rajan</surname> <given-names>K.</given-names></name> <name><surname>Escola</surname> <given-names>G. S.</given-names></name> <name><surname>Abbott</surname> <given-names>L. F.</given-names></name></person-group> (<year>2018</year>). <article-title>full-force: a target-based method for training recurrent networks</article-title>. <source>PLoS ONE</source> <volume>13</volume>, <fpage>1</fpage>&#x02013;<lpage>18</lpage>. <pub-id pub-id-type="doi">10.1371/journal.pone.0191527</pub-id><pub-id pub-id-type="pmid">29415041</pub-id></citation></ref>
<ref id="B16">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Dinh</surname> <given-names>H.</given-names></name> <name><surname>Kamalapurkar</surname> <given-names>R.</given-names></name> <name><surname>Bhasin</surname> <given-names>S.</given-names></name> <name><surname>Dixon</surname> <given-names>W.</given-names></name></person-group> (<year>2014</year>). <article-title>Dynamic neural network-based robust observers for uncertain nonlinear systems</article-title>. <source>Neural Netw</source>. <volume>60</volume>, <fpage>44</fpage>&#x02013;<lpage>52</lpage>. <pub-id pub-id-type="doi">10.1016/j.neunet.2014.07.009</pub-id><pub-id pub-id-type="pmid">25128659</pub-id></citation></ref>
<ref id="B17">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Engelken</surname> <given-names>R.</given-names></name> <name><surname>Ingrosso</surname> <given-names>A.</given-names></name> <name><surname>Khajeh</surname> <given-names>R.</given-names></name> <name><surname>Goedeke</surname> <given-names>S.</given-names></name> <name><surname>Abbott</surname> <given-names>L. F.</given-names></name></person-group> (<year>2022</year>). <article-title>Input correlations impede suppression of chaos and learning in balanced firing-rate networks</article-title>. <source>PLoS Comput. Biol</source>. <volume>18</volume>, <fpage>1</fpage>&#x02013;<lpage>23</lpage>. <pub-id pub-id-type="doi">10.1371/journal.pcbi.1010590</pub-id><pub-id pub-id-type="pmid">36469504</pub-id></citation></ref>
<ref id="B18">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Floyd</surname> <given-names>T.</given-names></name></person-group> (<year>2003</year>). <source>Digital Fundamentals</source>. <publisher-loc>Hoboken</publisher-loc>: <publisher-name>Prentice Hall</publisher-name>.</citation>
</ref>
<ref id="B19">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Freedman</surname> <given-names>D. J.</given-names></name> <name><surname>Assad</surname> <given-names>J. A.</given-names></name></person-group> (<year>2006</year>). <article-title>Experience-dependent representation of visual categories in parietal cortex</article-title>. <source>Nature</source> <volume>443</volume>:<fpage>85</fpage>&#x02013;<lpage>88</lpage>. <pub-id pub-id-type="doi">10.1038/nature05078</pub-id><pub-id pub-id-type="pmid">16936716</pub-id></citation></ref>
<ref id="B20">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Funahashi</surname> <given-names>K.</given-names></name> <name><surname>Nakamura</surname> <given-names>Y.</given-names></name></person-group> (<year>1993</year>). <article-title>Approximation of dynamical systems by continuous time recurrent neural networks</article-title>. <source>Neural Networks</source> <volume>6</volume>, <fpage>801</fpage>&#x02013;<lpage>806</lpage>. <pub-id pub-id-type="doi">10.1016/S0893-6080(05)80125-X</pub-id></citation>
</ref>
<ref id="B21">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Gudowska-Nowak</surname> <given-names>E.</given-names></name> <name><surname>Nowak</surname> <given-names>M. A.</given-names></name> <name><surname>Chialvo</surname> <given-names>D. R.</given-names></name> <name><surname>Ochab</surname> <given-names>J. K.</given-names></name> <name><surname>Tarnowski</surname> <given-names>W.</given-names></name></person-group> (<year>2020</year>). <article-title>From synaptic interactions to collective dynamics in random neuronal networks models: critical role of eigenvectors and transient behavior</article-title>. <source>Neural Comput</source>. <volume>32</volume>, <fpage>395</fpage>&#x02013;<lpage>423</lpage>. <pub-id pub-id-type="doi">10.1162/neco_a_01253</pub-id><pub-id pub-id-type="pmid">31835001</pub-id></citation></ref>
<ref id="B22">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Gulli</surname> <given-names>A.</given-names></name> <name><surname>Pal</surname> <given-names>S.</given-names></name></person-group> (<year>2017</year>). <source>Deep Learning with Keras: Implementing Deep Learning Models and Neural Networks with the Power of Python</source>. <publisher-loc>Birmingham</publisher-loc>: <publisher-name>Packt Publishing</publisher-name>.</citation>
</ref>
<ref id="B23">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Harris</surname> <given-names>C. R.</given-names></name> <name><surname>Millman</surname> <given-names>K. J.</given-names></name> <name><surname>van der Walt</surname> <given-names>S. J.</given-names></name> <name><surname>Gommers</surname> <given-names>R.</given-names></name> <name><surname>Virtanen</surname> <given-names>P.</given-names></name> <name><surname>Cournapeau</surname> <given-names>D.</given-names></name> <etal/></person-group>. (<year>2020</year>). <article-title>Array programming with numpy</article-title>. <source>Nature</source> <volume>585</volume>, <fpage>357</fpage>&#x02013;<lpage>362</lpage>. <pub-id pub-id-type="doi">10.1038/s41586-020-2649-2</pub-id><pub-id pub-id-type="pmid">32939066</pub-id></citation></ref>
<ref id="B24">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Hopfield</surname> <given-names>J. J.</given-names></name></person-group> (<year>1984</year>). <article-title>Neurons with graded response have collective computational properties like those of two-state neurons</article-title>. <source>Proc. Nat. Acad. Sci</source>. <volume>81</volume>, <fpage>3088</fpage>&#x02013;<lpage>3092</lpage>. <pub-id pub-id-type="doi">10.1073/pnas.81.10.3088</pub-id><pub-id pub-id-type="pmid">6587342</pub-id></citation></ref>
<ref id="B25">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Hornik</surname> <given-names>K.</given-names></name></person-group> (<year>1991</year>). <article-title>Approximation capabilities of multilayer feedforward networks</article-title>. <source>Neural Networks</source> <volume>4</volume>, <fpage>251</fpage>&#x02013;<lpage>257</lpage>. <pub-id pub-id-type="doi">10.1016/0893-6080(91)90009-T</pub-id></citation>
</ref>
<ref id="B26">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ingrosso</surname> <given-names>A.</given-names></name> <name><surname>Abbott</surname> <given-names>L. F.</given-names></name></person-group> (<year>2019</year>). <article-title>Training dynamically balanced excitatory-inhibitory networks</article-title>. <source>PLoS ONE</source> <volume>14</volume>, <fpage>1</fpage>&#x02013;<lpage>18</lpage>. <pub-id pub-id-type="doi">10.1371/journal.pone.0220547</pub-id><pub-id pub-id-type="pmid">31393909</pub-id></citation></ref>
<ref id="B27">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Jarne</surname> <given-names>C.</given-names></name></person-group> (<year>2021</year>). <article-title>Multitasking in RNN: an analysis exploring the combination of simple tasks</article-title>. <source>J. Phys. Complex</source> <volume>2</volume>, <fpage>015009</fpage>. <pub-id pub-id-type="doi">10.1088/2632-072X/abdee3</pub-id></citation>
</ref>
<ref id="B28">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Jarne</surname> <given-names>C.</given-names></name></person-group> (<year>2022</year>). <article-title>Different eigenvalue distributions encode the same temporal tasks in recurrent neural networks</article-title>. <source>Cogn. Neurodyn.</source> <volume>17</volume>, <fpage>257</fpage>&#x02013;<lpage>275</lpage>. <pub-id pub-id-type="doi">10.1007/s11571-022-09802-5</pub-id><pub-id pub-id-type="pmid">35469119</pub-id></citation></ref>
<ref id="B29">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Jarne</surname> <given-names>C.</given-names></name> <name><surname>Caruso</surname> <given-names>M.</given-names></name></person-group> (<year>2023</year>). <article-title>Effect in the spectra of eigenvalues and dynamics of RNNs trained with excitatory-inhibitory constraint</article-title>. <source>Cogn. Neurodyn.</source> <pub-id pub-id-type="doi">10.1007/s11571-023-09956-w</pub-id></citation>
</ref>
<ref id="B30">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Jarne</surname> <given-names>C.</given-names></name> <name><surname>Laje</surname> <given-names>R.</given-names></name></person-group> (<year>2023</year>). <article-title>Exploring weight initialization, diversity of solutions, and degradation in recurrent neural networks trained for temporal and decision-making tasks</article-title>. <source>J. Comput. Neurosci</source>. <volume>51</volume>, <fpage>407</fpage>&#x02013;<lpage>431</lpage>. <pub-id pub-id-type="doi">10.1007/s10827-023-00857-9</pub-id><pub-id pub-id-type="pmid">37561278</pub-id></citation></ref>
<ref id="B31">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Kao</surname> <given-names>T.-C.</given-names></name> <name><surname>Hennequin</surname> <given-names>G.</given-names></name></person-group> (<year>2019</year>). <article-title>Neuroscience out of control: control-theoretic perspectives on neural circuit dynamics</article-title>. <source>Curr. Opin. Neurobiol</source>. <volume>58</volume>, <fpage>122</fpage>&#x02013;<lpage>129</lpage>. <pub-id pub-id-type="doi">10.1016/j.conb.2019.09.001</pub-id><pub-id pub-id-type="pmid">31563084</pub-id></citation></ref>
<ref id="B32">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Khan</surname> <given-names>S.</given-names></name> <name><surname>Ahmad</surname> <given-names>J.</given-names></name> <name><surname>Naseem</surname> <given-names>I.</given-names></name> <name><surname>Moinuddin</surname> <given-names>M.</given-names></name></person-group> (<year>2018</year>). <article-title>A novel fractional gradient-based learning algorithm for recurrent neural networks</article-title>. <source>Circu. Syst. Signal Proc</source>. <volume>37</volume>, <fpage>593</fpage>&#x02013;<lpage>612</lpage>. <pub-id pub-id-type="doi">10.1007/s00034-017-0572-z</pub-id></citation>
</ref>
<ref id="B33">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Kim</surname> <given-names>R.</given-names></name> <name><surname>Li</surname> <given-names>Y.</given-names></name> <name><surname>Sejnowski</surname> <given-names>T. J.</given-names></name></person-group> (<year>2019</year>). <article-title>Simple framework for constructing functional spiking recurrent neural networks</article-title>. <source>Proc. Nat. Acad. Sci</source>. <volume>116</volume>, <fpage>22811</fpage>&#x02013;<lpage>22820</lpage>. <pub-id pub-id-type="doi">10.1073/pnas.1905926116</pub-id><pub-id pub-id-type="pmid">31636215</pub-id></citation></ref>
<ref id="B34">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Kingma</surname> <given-names>D. P.</given-names></name> <name><surname>Ba</surname> <given-names>J.</given-names></name></person-group> (<year>2014</year>). <article-title>Adam: a method for stochastic optimization</article-title>. <source>arXiv preprint</source> arXiv:1412.6980.</citation>
</ref>
<ref id="B35">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Levi-Montalcini</surname> <given-names>R.</given-names></name></person-group> (<year>1987</year>). <article-title>The nerve growth factor 35 years later</article-title>. <source>Science</source> <volume>237</volume>, <fpage>1154</fpage>&#x02013;<lpage>1162</lpage>. <pub-id pub-id-type="doi">10.1126/science.3306916</pub-id><pub-id pub-id-type="pmid">3306916</pub-id></citation></ref>
<ref id="B36">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Levi-Montalcini</surname> <given-names>R.</given-names></name> <name><surname>Booker</surname> <given-names>B.</given-names></name></person-group> (<year>1960</year>). <article-title>Excessive growth of the sympathetic ganglia evoked by a protein isolated from mouse salivary glands &#x0003C; sup&#x0003E;* &#x0003C; /sup&#x0003E;</article-title>. <source>Proc. Nat. Acad. Sci</source>. <volume>46</volume>, <fpage>373</fpage>&#x02013;<lpage>384</lpage>. <pub-id pub-id-type="doi">10.1073/pnas.46.3.373</pub-id><pub-id pub-id-type="pmid">16578496</pub-id></citation></ref>
<ref id="B37">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Litjens</surname> <given-names>G.</given-names></name> <name><surname>Kooi</surname> <given-names>T.</given-names></name> <name><surname>Bejnordi</surname> <given-names>B. E.</given-names></name> <name><surname>Setio</surname> <given-names>A. A. A.</given-names></name> <name><surname>Ciompi</surname> <given-names>F.</given-names></name> <name><surname>Ghafoorian</surname> <given-names>M.</given-names></name> <etal/></person-group>. (<year>2017</year>). <article-title>A survey on deep learning in medical image analysis</article-title>. <source>Med. Image Anal</source>. <volume>42</volume>:<fpage>60</fpage>&#x02013;<lpage>88</lpage>. <pub-id pub-id-type="doi">10.1016/j.media.2017.07.005</pub-id><pub-id pub-id-type="pmid">28778026</pub-id></citation></ref>
<ref id="B38">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Maass</surname> <given-names>W.</given-names></name> <name><surname>Natschl&#x000E4;ger</surname> <given-names>T.</given-names></name> <name><surname>Markram</surname> <given-names>H.</given-names></name></person-group> (<year>2002</year>). <article-title>Real-time computing without stable states: a new framework for neural computation based on perturbations</article-title>. <source>Neural Comput</source>. <volume>14</volume>, <fpage>2531</fpage>&#x02013;<lpage>2560</lpage>. <pub-id pub-id-type="doi">10.1162/089976602760407955</pub-id><pub-id pub-id-type="pmid">12433288</pub-id></citation></ref>
<ref id="B39">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Mante</surname> <given-names>V.</given-names></name> <name><surname>Sussillo</surname> <given-names>D.</given-names></name> <name><surname>Shenoy</surname> <given-names>K. V.</given-names></name> <name><surname>Newsome</surname> <given-names>W. T.</given-names></name></person-group> (<year>2013</year>). <article-title>Context-dependent computation by recurrent dynamics in prefrontal cortex</article-title>. <source>Nature</source> <volume>503</volume>, <fpage>78</fpage>&#x02013;<lpage>84</lpage>. <pub-id pub-id-type="doi">10.1038/nature12742</pub-id><pub-id pub-id-type="pmid">24201281</pub-id></citation></ref>
<ref id="B40">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>McCulloch</surname> <given-names>W. S.</given-names></name> <name><surname>Pitts</surname> <given-names>W.</given-names></name></person-group> (<year>1943</year>). <article-title>A logical calculus of the ideas immanent in nervous activity</article-title>. <source>Bull. Math. Biophys</source>. <volume>5</volume>, <fpage>115</fpage>&#x02013;<lpage>133</lpage>. <pub-id pub-id-type="doi">10.1007/BF02478259</pub-id><pub-id pub-id-type="pmid">2185863</pub-id></citation></ref>
<ref id="B41">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Min</surname> <given-names>S.</given-names></name> <name><surname>Lee</surname> <given-names>B.</given-names></name> <name><surname>Yoon</surname> <given-names>S.</given-names></name></person-group> (<year>2016</year>). <article-title>Deep learning in bioinformatics</article-title>. <source>Brief. Bioinformatics</source> <volume>18</volume>, <fpage>851</fpage>&#x02013;<lpage>869</lpage>. <pub-id pub-id-type="doi">10.1093/bib/bbw068</pub-id></citation>
</ref>
<ref id="B42">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Mohajerin</surname> <given-names>N.</given-names></name> <name><surname>Waslander</surname> <given-names>S. L.</given-names></name></person-group> (<year>2017</year>). <article-title>&#x0201C;State initialization for recurrent neural network modeling of time-series data,&#x0201D;</article-title> in <source>2017 International Joint Conference on Neural Networks (IJCNN)</source> (<publisher-loc>Anchorage</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>2330</fpage>&#x02013;<lpage>2337</lpage>. <pub-id pub-id-type="doi">10.1109/IJCNN.2017.7966138</pub-id></citation>
</ref>
<ref id="B43">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Murphy</surname> <given-names>B. K.</given-names></name> <name><surname>Miller</surname> <given-names>K. D.</given-names></name></person-group> (<year>2009</year>). <article-title>Balanced amplification: A new mechanism of selective amplification of neural activity patterns</article-title>. <source>Neuron</source> <volume>61</volume>, <fpage>635</fpage>&#x02013;<lpage>648</lpage>. <pub-id pub-id-type="doi">10.1016/j.neuron.2009.02.005</pub-id><pub-id pub-id-type="pmid">19249282</pub-id></citation></ref>
<ref id="B44">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ogunfunmi</surname> <given-names>T.</given-names></name> <name><surname>Ramachandran</surname> <given-names>R. P.</given-names></name> <name><surname>Togneri</surname> <given-names>R.</given-names></name> <name><surname>Zhao</surname> <given-names>Y.</given-names></name> <name><surname>Xia</surname> <given-names>X.</given-names></name></person-group> (<year>2019</year>). <article-title>A primer on deep learning architectures and applications in speech processing</article-title>. <source>Circu. Syst. Signal Proc</source>. <volume>38</volume>, <fpage>3406</fpage>&#x02013;<lpage>3432</lpage>. <pub-id pub-id-type="doi">10.1007/s00034-019-01157-3</pub-id></citation>
</ref>
<ref id="B45">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Pals</surname> <given-names>M.</given-names></name> <name><surname>Macke</surname> <given-names>J. H.</given-names></name> <name><surname>Barak</surname> <given-names>O.</given-names></name></person-group> (<year>2024</year>). <article-title>Trained recurrent neural networks develop phase-locked limit cycles in a working memory task</article-title>. <source>PLoS Comput. Biol</source>. <volume>20</volume>, <fpage>1</fpage>&#x02013;<lpage>23</lpage>. <pub-id pub-id-type="doi">10.1371/journal.pcbi.1011852</pub-id><pub-id pub-id-type="pmid">38315736</pub-id></citation></ref>
<ref id="B46">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Pascanu</surname> <given-names>R.</given-names></name> <name><surname>Mikolov</surname> <given-names>T.</given-names></name> <name><surname>Bengio</surname> <given-names>Y.</given-names></name></person-group> (<year>2013</year>). <article-title>&#x0201C;On the difficulty of training recurrent neural networks,&#x0201D;</article-title> in <source>Proceedings of the 30th International Conference on Machine Learning, PMLR, Vol. 28</source>, <fpage>1310</fpage>&#x02013;<lpage>1318</lpage>.</citation>
</ref>
<ref id="B47">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Paszke</surname> <given-names>A.</given-names></name> <name><surname>Gross</surname> <given-names>S.</given-names></name> <name><surname>Massa</surname> <given-names>F.</given-names></name> <name><surname>Lerer</surname> <given-names>A.</given-names></name> <name><surname>Bradbury</surname> <given-names>J.</given-names></name> <name><surname>Chanan</surname> <given-names>G.</given-names></name> <etal/></person-group>. (<year>2019</year>). <article-title>&#x0201C;Pytorch: an imperative style, high-performance deep learning library,&#x0201D;</article-title> in <source>Advances in Neural Information Processing Systems</source>, eds. H. Wallach, H. Larochelle, A. Beygelzimer, F. d&#x00027; Alch&#x000E9;-Buc, E. Fox, and R. Garnett (<publisher-loc>New York</publisher-loc>: <publisher-name>Curran Associates Inc</publisher-name>), <fpage>8024</fpage>&#x02013;<lpage>8035</lpage>.</citation>
</ref>
<ref id="B48">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Pedregosa</surname> <given-names>F.</given-names></name> <name><surname>Varoquaux</surname> <given-names>G.</given-names></name> <name><surname>Gramfort</surname> <given-names>A.</given-names></name> <name><surname>Michel</surname> <given-names>V.</given-names></name> <name><surname>Thirion</surname> <given-names>B.</given-names></name> <name><surname>Grisel</surname> <given-names>O.</given-names></name> <etal/></person-group>. (<year>2011</year>). <article-title>Scikit-learn: machine learning in python</article-title>. <source>J. Mach. Learn. Res</source>. <volume>12</volume>, <fpage>2825</fpage>&#x02013;<lpage>2830</lpage>. <pub-id pub-id-type="doi">10.48550/arXiv.1201.0490</pub-id></citation>
</ref>
<ref id="B49">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Rajan</surname> <given-names>K.</given-names></name> <name><surname>Abbott</surname> <given-names>L. F.</given-names></name></person-group> (<year>2006</year>). <article-title>Eigenvalue spectra of random matrices for neural networks</article-title>. <source>Phys. Rev. Lett</source>. 97, 188104. <pub-id pub-id-type="doi">10.1103/PhysRevLett.97.188104</pub-id><pub-id pub-id-type="pmid">17155583</pub-id></citation></ref>
<ref id="B50">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Ramsundar</surname> <given-names>B.</given-names></name> <name><surname>Zadeh</surname> <given-names>R. B.</given-names></name></person-group> (<year>2018</year>). <source>TensorFlow for Deep Learning: From Linear Regression to Reinforcement Learning</source>. <publisher-loc>Sebastopol, CA</publisher-loc>: <publisher-name>O&#x00027;Reilly Media Inc</publisher-name>.</citation>
</ref>
<ref id="B51">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Roitman</surname> <given-names>J. D.</given-names></name> <name><surname>Shadlen</surname> <given-names>M. N.</given-names></name></person-group> (<year>2002</year>). <article-title>Response of neurons in the lateral intraparietal area during a combined visual discrimination reaction time task</article-title>. <source>J. Neurosci</source>. <volume>22</volume>, <fpage>9475</fpage>&#x02013;<lpage>9489</lpage>. <pub-id pub-id-type="doi">10.1523/JNEUROSCI.22-21-09475.2002</pub-id><pub-id pub-id-type="pmid">12417672</pub-id></citation></ref>
<ref id="B52">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>SHI</surname> <given-names>X.</given-names></name> <name><surname>Chen</surname> <given-names>Z.</given-names></name> <name><surname>Wang</surname> <given-names>H.</given-names></name> <name><surname>Yeung</surname> <given-names>D.-Y.</given-names></name> <name><surname>Wong</surname> <given-names>W.- k. W. O. O. </given-names></name></person-group>. (<year>2015</year>). <article-title>&#x0201C;Convolutional lstm network: a machine learning approach for precipitation nowcasting,&#x0201D;</article-title> in <source>Advances in Neural Information Processing Systems</source>, eds. C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (New York: Curran Associates Inc), <fpage>802</fpage>&#x02013;<lpage>810</lpage>.</citation>
</ref>
<ref id="B53">
<citation citation-type="book"><person-group person-group-type="author"><name><surname>Singh</surname> <given-names>P.</given-names></name> <name><surname>Manure</surname> <given-names>A.</given-names></name></person-group> (<year>2019</year>). <source>Learn TensorFlow 2.0: Implement Machine Learning and Deep Learning Models with Python</source>. <publisher-loc>New York</publisher-loc>: <publisher-name>Apress</publisher-name>.</citation>
</ref>
<ref id="B54">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Song</surname> <given-names>H. F.</given-names></name> <name><surname>Yang</surname> <given-names>G. R.</given-names></name> <name><surname>Wang</surname> <given-names>X.-J.</given-names></name></person-group> (<year>2016</year>). <article-title>Training excitatory-inhibitory recurrent neural networks for cognitive tasks: a simple and flexible framework</article-title>. <source>PLoS Comput. Biol</source>. <volume>12</volume>, <fpage>1</fpage>&#x02013;<lpage>30</lpage>. <pub-id pub-id-type="doi">10.1371/journal.pcbi.1004792</pub-id><pub-id pub-id-type="pmid">26928718</pub-id></citation></ref>
<ref id="B55">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Sussillo</surname> <given-names>D.</given-names></name></person-group> (<year>2014</year>). <article-title>Neural circuits as computational dynamical systems</article-title>. <source>Curr. Opini.Neurobiol</source>. <volume>25</volume>, <fpage>156</fpage>&#x02013;<lpage>163</lpage>. <pub-id pub-id-type="doi">10.1016/j.conb.2014.01.008</pub-id><pub-id pub-id-type="pmid">24509098</pub-id></citation></ref>
<ref id="B56">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Sussillo</surname> <given-names>D.</given-names></name> <name><surname>Abbott</surname> <given-names>L.</given-names></name></person-group> (<year>2009</year>). <article-title>Generating coherent patterns of activity from chaotic neural networks</article-title>. <source>Neuron</source> <volume>63</volume>, <fpage>18</fpage>. <pub-id pub-id-type="doi">10.1016/j.neuron.2009.07.018</pub-id><pub-id pub-id-type="pmid">19709635</pub-id></citation></ref>
<ref id="B57">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Sussillo</surname> <given-names>D.</given-names></name> <name><surname>Barak</surname> <given-names>O.</given-names></name></person-group> (<year>2013</year>). <article-title>Opening the black box: low-dimensional dynamics in high-dimensional recurrent neural networks</article-title>. <source>Neural Comput</source>. <volume>25</volume>, <fpage>626</fpage>&#x02013;<lpage>649</lpage>. <pub-id pub-id-type="doi">10.1162/NECO_a_00409</pub-id><pub-id pub-id-type="pmid">23272922</pub-id></citation></ref>
<ref id="B58">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Vyas</surname> <given-names>S.</given-names></name> <name><surname>Golub</surname> <given-names>M. D.</given-names></name> <name><surname>Sussillo</surname> <given-names>D.</given-names></name> <name><surname>Shenoy</surname> <given-names>K. V.</given-names></name></person-group> (<year>2020</year>). <article-title>Computation through neural population dynamics</article-title>. <source>Annual Rev. Neurosci</source>. <volume>43</volume>, <fpage>249</fpage>&#x02013;<lpage>275</lpage>. <pub-id pub-id-type="doi">10.1146/annurev-neuro-092619-094115</pub-id><pub-id pub-id-type="pmid">32640928</pub-id></citation></ref>
<ref id="B59">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Werbos</surname> <given-names>P.</given-names></name></person-group> (<year>1990</year>). <article-title>Backpropagation through time: what it does and how to do it</article-title>. <source>Proceedings of the IEEE</source> <volume>78</volume>:<fpage>1550</fpage>&#x02013;<lpage>1560</lpage>. <pub-id pub-id-type="doi">10.1109/5.58337</pub-id></citation>
</ref>
<ref id="B60">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Williams</surname> <given-names>A. H.</given-names></name> <name><surname>Kim</surname> <given-names>T. H.</given-names></name> <name><surname>Wang</surname> <given-names>F.</given-names></name> <name><surname>Vyas</surname> <given-names>S.</given-names></name> <name><surname>Ryu</surname> <given-names>S. I.</given-names></name> <name><surname>Shenoy</surname> <given-names>K. V.</given-names></name> <etal/></person-group>. (<year>2018</year>). <article-title>Unsupervised discovery of demixed, low-dimensional neural dynamics across multiple timescales through tensor component analysis</article-title>. <source>Neuron</source> <volume>98</volume>, <fpage>1099</fpage>&#x02013;<lpage>1115</lpage>. <pub-id pub-id-type="doi">10.1016/j.neuron.2018.05.015</pub-id><pub-id pub-id-type="pmid">29887338</pub-id></citation></ref>
<ref id="B61">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Yang</surname> <given-names>G. R.</given-names></name> <name><surname>Wang</surname> <given-names>X.-J.</given-names></name></person-group> (<year>2020</year>). <article-title>Artificial neural networks for neuroscientists: a primer</article-title>. <source>Neuron</source> <volume>107</volume>, <fpage>1048</fpage>&#x02013;<lpage>1070</lpage>. <pub-id pub-id-type="doi">10.1016/j.neuron.2020.09.005</pub-id></citation>
</ref>
<ref id="B62">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Yang</surname> <given-names>S.</given-names></name> <name><surname>Chen</surname> <given-names>B.</given-names></name></person-group> (<year>2023a</year>). <article-title>Effective surrogate gradient learning with high-order information bottleneck for spike-based machine intelligence</article-title>. <source>IEEE Trans. Neural Netw. Learn Syst</source>. <fpage>1</fpage>&#x02013;<lpage>15</lpage>.<pub-id pub-id-type="pmid">37991917</pub-id></citation></ref>
<ref id="B63">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Yang</surname> <given-names>S.</given-names></name> <name><surname>Chen</surname> <given-names>B.</given-names></name></person-group> (<year>2023b</year>). <article-title>Snib: Improving spike-based machine learning using nonlinear information bottleneck</article-title>. <source>IEEE Trans. Syst. Man, Cybernet.: Syst</source>. <volume>53</volume>, <fpage>7852</fpage>&#x02013;<lpage>7863</lpage>. <pub-id pub-id-type="doi">10.1109/TSMC.2023.3300318</pub-id></citation>
</ref>
<ref id="B64">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Yang</surname> <given-names>S.</given-names></name> <name><surname>Linares-Barranco</surname> <given-names>B.</given-names></name> <name><surname>Chen</surname> <given-names>B.</given-names></name></person-group> (<year>2022a</year>). <article-title>Heterogeneous ensemble-based spike-driven few-shot online learning</article-title>. <source>Front. Neurosci</source>. 16, 850932. <pub-id pub-id-type="doi">10.3389/fnins.2022.850932</pub-id><pub-id pub-id-type="pmid">35615277</pub-id></citation></ref>
<ref id="B65">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Yang</surname> <given-names>S.</given-names></name> <name><surname>Pang</surname> <given-names>Y.</given-names></name> <name><surname>Wang</surname> <given-names>H.</given-names></name> <name><surname>Lei</surname> <given-names>T.</given-names></name> <name><surname>Pan</surname> <given-names>J.</given-names></name> <name><surname>Wang</surname> <given-names>J.</given-names></name> <etal/></person-group>. (<year>2023</year>). <article-title>Spike-driven multi-scale learning with hybrid mechanisms of spiking dendrites</article-title>. <source>Neurocomputing</source> <volume>542</volume>, <fpage>126240</fpage>. <pub-id pub-id-type="doi">10.1016/j.neucom.2023.126240</pub-id></citation>
</ref>
<ref id="B66">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Yang</surname> <given-names>S.</given-names></name> <name><surname>Tan</surname> <given-names>J.</given-names></name> <name><surname>Chen</surname> <given-names>B.</given-names></name></person-group> (<year>2022b</year>). <article-title>Robust spike-based continual meta-learning improved by restricted minimum error entropy criterion</article-title>. <source>Entropy</source> <volume>24</volume>, <fpage>4</fpage>. <pub-id pub-id-type="doi">10.3390/e24040455</pub-id><pub-id pub-id-type="pmid">35455118</pub-id></citation></ref>
<ref id="B67">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Zhang</surname> <given-names>X.</given-names></name> <name><surname>Liu</surname> <given-names>S.</given-names></name> <name><surname>Chen</surname> <given-names>Z. S.</given-names></name></person-group> (<year>2021</year>). <article-title>A geometric framework for understanding dynamic information integration in context-dependent computation</article-title>. <source>iScience</source> <volume>24</volume>, <fpage>8</fpage>. <pub-id pub-id-type="doi">10.1016/j.isci.2021.102919</pub-id><pub-id pub-id-type="pmid">34430809</pub-id></citation></ref>
<ref id="B68">
<citation citation-type="journal"><person-group person-group-type="author"><name><surname>Zhou</surname> <given-names>Q.</given-names></name> <name><surname>Jin</surname> <given-names>T.</given-names></name> <name><surname>Zhao</surname> <given-names>H.</given-names></name></person-group> (<year>2009</year>). <article-title>Correlation between eigenvalue spectra and dynamics of neural networks</article-title>. <source>Neural Computation</source>, <volume>21</volume>, <fpage>2931</fpage>&#x02013;<lpage>2941</lpage>. <pub-id pub-id-type="doi">10.1162/neco.2009.12-07-671</pub-id><pub-id pub-id-type="pmid">19635013</pub-id></citation></ref>
</ref-list>
</back>
</article>
