NEF–SPA CIRCUIT LAB

CHAPTER 2 · FOUNDATIONS OF NENGO, NEF AND SPA

Understanding NEF–SPA Circuits
in Speech Processing Models

Nengo Examples Chapter 2.4–…
Continue from representation and memory to the circuits that control when neural activity can influence another population.

READING GUIDE · CHAPTERS 2.4–2.7

Control, temporal dynamics and structured meaning

The teaching script now introduces these foundations in four separate sections. They answer different questions and can work together in one neural model.

SectionQuestionWhat it introduces
2.4 · Neural gatingMay this pathway influence its recipient now?Local relays, inhibition, read/write permissions and gating a complete word pointer.
2.5 · Neural action selection and routingWhich operation or route should be enabled?NengoSPA routing, procedural knowledge, basal ganglia and thalamus, and their connection to local readiness.
2.6 · Oscillators and gesturesHow does an enabled process develop over time?Oscillators, ramp integrators and gesture activation, followed by phase decoding and the roles of gates.
2.7 · Binding and structured meaningWhich property belongs to which object, and who fills which role?Binding, bundling, unbinding and cleanup; red car / green ball; event roles; a recorded spiking circuit in the PDF.

Routing is not automatically action selection. Routing specifies where content is sent. Action selection chooses among operations and can recruit local gates to enable a route. Such selection can concern a broader task, such as naming versus repetition, but it need not control every process in the model.

Temporal dynamics have their own foundation. The script first explains a cycle and a ramp, then asks how gates control their start and influence. It distinguishes an ideal integrator, which holds its accumulated state when its input ends, from the archived gesture ramps, whose bounded, attenuated feedback allows activation to decay.

From the whole system to its neural circuits. Introduction 1.2 · Neural Modeling: Micro- and Macrostructures · PDF pages 8–10 connects the Common Model of Cognition with the reusable circuits below and explains their biological interpretation.

New in the teaching script: binding. Read Chapter 2.7 · PDF pages 78–86 for the two colour assignments, participant roles, circuit diagrams, Nengo code and recorded neural activity. Download the source, saved recording and figures. The scene example is a local circuit demonstration; the sentence structures explain a possible extension of the production pathways.

Chapter 3 applies these foundations to the concept-to-phonological-form pathway; Chapter 4 applies them to syllables and articulation. The recorded examples below retain their existing circuits and data.

Our running example is word gating: the central buffer holds the current word while a source already offers the following word. The scalar examples below isolate one coordinate of the mechanism before we discuss read and write permissions for word content.

EXAMPLE 07 · BEFORE GATING · §2.4.1

Before gating: Different spikes. The same content.

Recorded Nengo simulation

An ordinary connection can carry a value from a source population to a recipient population without copying its spike pattern. Both populations generate their own spikes. The weights between them translate one population’s neural code into drive appropriate for the other.

Read §2.4.1 · ordinary connection and recorded spikes · PDF pages 41–42

A direct connection carries a scalar between two populationsA supplied scalar drives a source ensemble of 100 LIF neurons, connected directly to a separately tuned recipient ensemble of 100 LIF neurons. The connection requests the identity transformation and uses a 10-millisecond filter. No gate or intermediate population is present. Supplied valuex(t) Source100 LIF neurons Identity: x → xWeighted, filtered spikes Recipient100 LIF neurons Both connections: 10 ms · separate observation probes: 10 ms each

Two ordinary ensembles with different tuning properties. “Source” and “recipient” name their roles. Neither has recurrent feedback. A relay, introduced below, is also an ordinary population given a forwarding role; it is not a special neuron type.

What stays the same?

The requested scalar: first +0.65, then −0.55, then +0.35. This is a simple functional content, not yet a word. It can help us understand transmission of the coordinates of a word pointer later.

What can be different?

The active neurons, their firing rates and spike times. A suitable readout of each population nevertheless recovers approximately the same value. Neuron numbers are local labels; source neuron 1 need not correspond to recipient neuron 1.

— / 2.400 s

Loading the recorded simulation…

Inspect:

Replay of saved Nengo activity. The controls change the viewing time, not the circuit or its inputs.

AT THE CURRENT CURSORLoading…

Source—One neural pattern
Recipient—A different neural pattern

Dots show the same first 20 cells as the rasters. A dot remains lit for 25 ms after a saved spike; its brightness is not membrane voltage. The numbers are decoded from all 100 cells per population.

SourceRecipientSupplied scalar (dashed)
A Content carried by both populations10-ms observation filters
B Source spikesCells 1–20 of 100
C Recipient spikesCells 1–20 of 100

All panels share a time axis. Readouts and spikes are revealed up to the cursor. Both readouts fluctuate; the recipient follows with additional filtering and neuronal dynamics. No artificial noise was added.

Content is not a spike count

During 0.30–0.70 s, the source emits 1,588 spikes and the recipient 1,799, counting all 100 cells in each. Their mean readouts are +0.643 and +0.644. Which neurons fire, and with which decoding weights, matters.

A negative scalar is also carried by ordinary spikes. It is not a negative firing rate or an instruction to inhibit the recipient.

Saved values at —
ObservationValue

Approximate agreement after settling

Means in three fixed windows of this single recording
Window (s)SuppliedSourceRecipient
0.30–0.70+0.650+0.643+0.644
1.00–1.50−0.550−0.549−0.555
1.80–2.30+0.350+0.354+0.353

The identity operation preserves the intended content approximately. It does not promise identical moment-by-moment readouts or spike trains. These are observations of one small circuit, not an assessment of the complete speech model.

Where decoding, encoding and synaptic weights meet
  1. Source code: the source’s tuning properties determine how its neurons represent the scalar. Fitted decoding weights describe a useful readout of that activity.
  2. Connection weights: source decoding, the requested transformation, and the recipient’s encoders and gains together determine the effective synaptic weights. The recipient receives the weighted, filtered effects of source spikes.
  3. Recipient code: its own tuning and membrane dynamics produce new spikes. Its readout uses weights appropriate to this second population.

There is no extra decoding population followed by an encoding population between these two ensembles. Nengo can compute the connection efficiently in factored form; the equivalent neuron-to-neuron matrix here is 100 × 100. Its values are not an identity matrix. transform=1.0 specifies identity in the represented scalar space.

Different coding depends on tuning properties and neural states as well as the synaptic weights. This example fixes the connection weights before the run; it does not learn them through experience during playback.

For word pointers, two buffers can carry the same item in the same coordinate system using different neural patterns. A concept-to-phonological mapping between different vocabularies additionally needs the lexical association described in Chapter 2.2; an identity connection alone does not provide that mapping.

How this example was recorded

One 2.4-second simulation with Nengo 4.1.0 and NumPy 2.5.4. Network seed 241; source seed 2411; recipient seed 2412. Each ensemble has 100 LIF neurons, radius 1, maximum rates drawn uniformly from 80–160 Hz, and otherwise default tuning distributions. Membrane time constant: 20 ms; refractory period: 2 ms.

The scalar is zero until 0.10 s, +0.65 until 0.80 s, −0.55 until 1.60 s, then +0.35. Both connections and both decoded probes use 10-ms low-pass filters. Integration and recording use 1-ms steps. All 200 neurons are saved. No recurrence, gate or learning rule is included.

The NPZ file also retains encoders, gains, biases, connection decoding weights and the effective neuron-to-neuron matrix. The browser replays all 2,400 original samples and saved spike events. The static figure, script and checks can be downloaded below.

Full recording and weights (NPZ) · Browser recording (JSON) · Settings and checks · Static figure

The Nengo connection in a few lines

Inside a Nengo network, these lines create two populations with independently drawn tuning properties and request transmission of the same scalar. The downloadable script includes the supplied stimulus, exact neuron settings, probes, saved data, checks and figure generation.

source = nengo.Ensemble(100, dimensions=1, seed=2411)
recipient = nengo.Ensemble(100, dimensions=1, seed=2412)

nengo.Connection(source, recipient,
                 transform=1.0, synapse=0.01)

source_readout = nengo.Probe(source, synapse=0.01)
recipient_readout = nengo.Probe(recipient, synapse=0.01)
source_spikes = nengo.Probe(source.neurons)
recipient_spikes = nengo.Probe(recipient.neurons)

transform=1.0 is the identity operation. Replacing it with transform=0.5 would request multiplication by a fixed factor: +0.65 should become approximately +0.325 after settling. That variant is not the recording above. Multiplying two changing signals needs a different circuit; a fixed transform is not a gate that opens and closes during a run.

Complete reproducible Python example (ZIP) · Read the full source

Background: Nengo’s communication channel and connections in depth.

Now that ordinary transmission is visible, add a control population and watch the pathway close and reopen.

EXAMPLE 08 · §2.4.2 · NEURAL GATING

Closing and reopening a neural pathway

Recorded Nengo simulation

The source population represents a value with its spikes. The relay receives their weighted, filtered effects and produces its own spikes. A separate block population also sends spikes. Their combined effect can prevent relay neurons from reaching their firing threshold, closing this route while the source stays active.

Read §2.4.2 · population recording and block interval · PDF page 44 · Build the connections in Nengo · §2.4.4

A content pathway controlled by a neural block populationA supplied scalar drives a 100-neuron source, which drives a 100-neuron relay. A separate supplied command drives a 100-neuron block population. Its weighted, filtered spikes supply blocking drive, scaled by each relay neuron’s gain, that reduces the total current. A probe observes the relay output. All connections and readout filters are 10 milliseconds. Supplied command0 = open · 1 = block Block control b100 LIF neurons −5b̂ before target gainblocking drive Supplied content+0.65, then −0.55 Source100 LIF neurons Relay100 LIF neurons Decoded outputobservation only Every connection: 10 ms low-pass filter · decoded probes: another 10 ms

Ellipses are spiking populations. The two input boxes are supplied diagnostic signals; the output box is an observation. The purple bar marks the connection’s combined suppressive effect. Its drive is multiplied by each relay neuron’s gain at the relay.neurons interface. Connections remain in place when the gate closes.

Content: what is transmitted?

The source represents one signed scalar. A negative value is still carried by ordinary positive spikes. This small example isolates transmission before applying the same principle to vector-valued items.

Control: may it pass?

High block activity has a weighted, filtered effect that lowers the relay neurons’ total current. When blocking subsides, source activity can recruit the relay again. This is local gating; a basal-ganglia–thalamus circuit could supply control in a larger model.

From spikes to current and voltage: what b and −5b mean

The block population sends spikes, not a negative value

Each block neuron emits spikes with a fixed amplitude parameter in this LIF model. The control value is carried by the population’s pattern of spike timing and rates. The neurons need not fire together or at equal rates. Their spikes do not have amplitude b or 5b.

b is the represented block value: zero requests an open route; one requests blocking. The supplied command drives a population of 100 neurons. A weighted, filtered estimate read from its spikes is written b̂. It builds up, fluctuates and decays. During the settled interval 0.60–0.75 s, the observed block readout averages 0.991, while the population emits 1,806 spikes. The first number is a decoded value; the second counts spike events.

The connection turns weighted spikes into an input effect

Synaptic filtering spreads spike effects over time. Their weighted sum contributes to the receiving neuron’s input current. The factor −5 sets the connection’s blocking strength before target gain. Nengo 4.1.0 then applies each relay neuron’s positive gain αj. Thus its control-current contribution is Jblock,j = −5αjb̂conn. The total current also includes the source-dependent input and the neuron’s bias. The connection’s estimate b̂conn is causal; a separate observation probe does not itself drive the relay.

A LIF neuron has a membrane-voltage state. Current and voltage here use normalized model units, not amperes and millivolts. Input current drives it towards threshold, while a leak opposes accumulation. Here the membrane time constant is 20 ms. On crossing the normalized voltage threshold 1, the neuron emits a spike, resets to zero and has a 2-ms refractory period.

  1. Open: blocking activity is absent. Source input and bias make some relay neurons reach threshold repeatedly. Their own new spikes carry the content onward.
  2. Blocked: the added contribution lowers total current enough that the relay neurons no longer reach threshold. Source signals still arrive. Without new relay spikes, the previous filtered output decays.
  3. Reopened: block activity and its filtered effect subside. Source input can again bring relay neurons to threshold. The connections remain in place throughout.

Inside relay neuron 1

These additional probes observe the same circuit. Every original input, decoded trace and spike array was reproduced exactly. The figure shows a shorter interval with constant source value +0.65.

Four recorded panels: block spikes, filtered block value, total current of relay neuron 1, and its voltage with output spikes. During blocking the current falls and voltage stays at zero; after release it rises and firing resumes.
A: spikes from 10 block cells. B: weighted, filtered block value from all 100 block neurons, reaching the relay. C: the cell’s total current. D: its normalized voltage; black marks identify output spikes. The sampled voltage has already been reset at a spike. Purple shading marks the supplied command. Dashed lines in C and D mark the constant-current firing boundary J = 1 and voltage threshold V = 1, respectively.

With constant total current, values above 1 can sustain firing; values below 1 cannot. For changing inputs, voltage history matters. The default LIF voltage has a floor of zero: strong inhibition holds this neuron at that floor, rather than creating a negative activation pattern. The plotted cell has gain 3.656 and bias approximately 1. At ideal steady values x = 0.65 and b̂conn = 0, J is approximately 3.38; at b̂conn = 1, it is approximately −14.91. The actual recorded current fluctuates.

What “inhibitory connection” means here. The route’s combined effect is suppressive in the blocking state. Its fitted decoding coefficients include both signs, so individual block spikes do not necessarily all lower current. This circuit does not enforce a separate biological inhibitory cell class. A sign-constrained interneuron implementation would need further assumptions. A negative represented content is also different from inhibition: the open relay can represent −0.55 while its neurons continue firing.

Additional recorded arrays (NPZ) · Current reconstruction and equality checks · Reproduce the additional probes and figure (ZIP)

— / 2.400 s

Loading the recorded simulation…

Inspect:

These controls replay saved samples. They do not change the circuit or its supplied commands.

AT THE CURRENT CURSORLoading…

Source—Content stays available
Block control—High activity closes the relay
Relay—Content passes when enabled

Each group shows the same first 20 neurons used in its raster. Dots remain lit for 25 ms after a recorded spike; they do not show membrane voltage. Numbers are decoded values from all 100 neurons.

SourceRelayBlock controlSupplied input / command (dashed)
A Content: source and relay readouts10-ms observation filter
B Control: block command and neural readoutPurple bands: blocking requested
C Source populationCells 1–20 of 100
D Block populationCells 1–20 of 100
E Relay populationCells 1–20 of 100

All panels share the same time axis. Curves and spikes are revealed up to the playback cursor. Shading shows the scheduled commands throughout. All 300 neurons were recorded; the downloads retain every spike.

A closed path does not erase its source

The inhibition targets the relay, so the source continues representing the supplied value. Here the source is input-driven; no recurrent memory is present. A closed relay’s filtered output also takes time to decay.

A value near zero does not by itself prove that neurons are silent. Compare the rasters and spike counts as well as the decoded value.

Saved values at —
ObservationValue

What the settled windows show

Means use the full populations. Spike counts below include all 100 source and all 100 relay neurons within each listed window.

Local observations in this single recorded run
Window (s)Source meanRelay meanSource spikesRelay spikes
Positive open · 0.15–0.350.6480.643795773
Positive blocked · 0.60–0.750.646≈06010
Negative open · 1.40–1.55−0.550−0.544507425
Negative blocked · 1.80–1.95−0.550≈05000

Both signs pass through an open relay. Both are suppressed when it is blocked. Inhibition means a suppressive contribution to neuronal current, not a negative firing rate.

LOOK CLOSER · LOCAL RESPONSE TIMES

Opening and closing take time

The supplied command, control-population response, relay response and filtered readout do not change simultaneously. Inspect one transition in the complete saved recording, independently of the playback cursor.

Closure is the first crossing below |relay readout| = 0.1 sustained for 20 ms; reopening uses |relay readout| > 0.4 for 20 ms. The recorded delays are 32 and 30 ms to close, and 47 and 51 ms to reopen. These include neuronal recruitment, connection filters and the observation filter. They describe this circuit, seed and input range, not a general gating latency or whole-model performance.

How this example was recorded

This is the original isolated 300-neuron simulation shown in §2.4.2, replayed from saved arrays. No artificial noise or new spikes have been added.

Neurons
Three ensembles × 100 LIF neurons · 1 dimension each · radius 1
Duration and recording
2.4 s · 1-ms integration and recording · 2,400 samples
Supplied content
+0.65 before 1.20 s; −0.55 from 1.20 s
Block commands
[0.40, 0.80) s and [1.60, 2.00) s
Connections and readouts
All four connections: 10-ms low-pass filters; decoded probes: 10 ms
Block population
Positive encoders; intercepts Uniform(0.2, 0.8); evaluation points Uniform(0, 1)
Neuronal settings
All maximum rates: Uniform(80, 160) Hz; source and relay encoders/intercepts: Nengo defaults
Inhibitory transformation
Pre-gain drive −5b̂conn; current contribution −5αjb̂conn for target neuron j
Software and seed
Nengo 4.1.0 · network seed 240
Spikes retained
23,255 events: source 8,762; block 9,338; relay 5,155

The two nengo.Node inputs supply diagnostic timing. Both content and control are then represented by spiking neurons. There is no recurrent buffer, learning rule or action-selection network in this isolated example. Other neuronal parameters retain Nengo defaults. The factor 5 is specific to these neurons and this input range. It is a connection coefficient, not a spike amplitude.

Replay data (JSON) · Original arrays (NPZ) · Original local observations · Static figure

The Nengo circuit in a few lines

The content connection targets the represented value of relay. The blocking connection targets relay.neurons; Nengo scales that input by each target neuron’s gain before adding it to the neuronal current. Nengo fits decoding weights when building the network; during simulation, weighted neural activity carries both effects.

# Inside with nengo.Network(seed=240):
# All populations use LIF and max_rates=Uniform(80, 160).
source = nengo.Ensemble(100, dimensions=1)
relay = nengo.Ensemble(100, dimensions=1)
block = nengo.Ensemble(100, dimensions=1,
    encoders=np.ones((100, 1)),
    intercepts=nengo.dists.Uniform(0.2, 0.8),
    eval_points=nengo.dists.Uniform(0, 1))

nengo.Connection(source, relay, synapse=0.01)
nengo.Connection(block, relay.neurons,
    transform=-5.0 * np.ones((100, 1)),
    synapse=0.01)

relay_readout = nengo.Probe(relay, synapse=0.01)
relay_spikes = nengo.Probe(relay.neurons)

The download includes both supplied inputs, every connection, probes, simulation, data saving and the checks for settled transmission, silence and response times. It is a standalone Nengo Core example; a Semantic Pointer vocabulary is unnecessary for this scalar circuit.

Complete Nengo example (Python) · Source, requirements and instructions (ZIP)

The official Nengo inhibitory-gating example documents the same target-neuron interface. This teaching circuit specifies effective current contributions; a cell-type-specific interneuron implementation would require additional assumptions.

TWO SEPARATE GATES · CHAPTER 2.4.5

Holding an item and reading it can happen together

The central recurrent buffer is the reference point. Write means writing into this buffer; read means reading from it; hold means maintaining its current item; and clear means removing its current item. These names keep the same reference point throughout the explanation.

Imagine a recurrent buffer holding item A while the incoming path already offers item B. Figure 24 in the teaching script shows two separately controlled gates: a write gate with its own relay population, and a read gate with a different relay population. Closing one does not require closing the other.

The upstream source offers the following item B. The central buffer holds the current item A. The downstream recipient can use A when the read gate opens. The central buffer receives content during writing and supplies content during reading. Whether the downstream recipient also stores that content depends on its own circuit.

Both gates can use the same kind of inhibition, applied to their respective relay neurons. The read relay carries the buffer’s content to a recipient. The write relay carries a correction to the stored content: the offered vector minus the buffer’s current decoded vector.

One coordination pattern for updating and reading a stable item
OperationWrite gateRead gateClear
Write/updateOpenClosed hereOff
Hold without readingClosedClosedOff
Hold and readClosedOpenOff
Clear/resetClosedClosed hereOn

Hold does not mean closing the read gate. Holding means that maintenance feedback supports the stored item while writing is blocked and clearing is inactive. The read gate can be closed or open. In Figure 24 it is open: A is held and read, although B is being offered.

Read does not inherently require a closed write gate. Keeping the write gate closed protects the stable item being read. Both gates could be open together, but the recipient would then receive a potentially changing state during updating. The table closes reading during writing and clearing to keep those transitions from reaching the recipient.

Two return connections with different jobs

The buffer’s maintenance feedback supports its stored item. A separate comparison connection sends the current state to the write-error relay, where it is subtracted from the offer. With writing enabled, the relay’s correction changes the buffer towards the offered item. With writing disabled, inhibition suppresses that correction, even if the inputs still arrive.

Figure 25 enlarges this same write circuit. It explains writing into the central buffer; the read relay and downstream recipient from Figure 24 are not shown. The write error compares the offered input with the central buffer’s current state. Closing the outgoing read gate does not interrupt this internal comparison connection. Clearing instead acts directly on the central buffer’s state neurons, with writing blocked to prevent immediate reloading.

The upper boxes in Figure 24 report write and read permissions. Each complete gate also includes its relay and control circuitry. The next explanation shows how neural conditions produce a permission and how it opens a relay.

Read §2.4.5 and Figures 24–25 (PDF pages 49–52) · §2.4.6: permission · Chapter 3: the protected word register.

FROM CONDITIONS TO TRANSMISSION · CHAPTER 2.4.6

How permission opens the gate we already know

Our running example is word gating. The central recurrent buffer holds the current word A while the source already offers the following word B. Read permission governs whether A can influence the downstream recipient; write permission governs whether B can update the central buffer. The scalar demonstrations isolate a coordinate of this mechanism; they do not represent complete words.

A permission signal represents that a particular operation is allowed. It can drive a control population, or it can be the decoded output of a population that already combines the relevant conditions. Its connections determine how it affects the relay. An additional control population is not required at every step.

The complete gate includes the relay and its control circuitry. Returning to Figure 24 in the manuscript: its upper boxes report write and read permissions, and its two relays below are where transmission is suppressed or enabled. Write and read permissions can differ.

The diagram below is Figure 26. It expands the control of one relay: conditions produce permission, whose connections change the relay’s drive. It does not redraw both gates around the recurrent buffer.

Neural conditions produce permission that releases a relay Ready, free and blocker populations converge on a condition population with a supplied constant minus-one offset. This offset and the tonic blocking drive are constant Nodes, whose neural sources are not modeled here. Its weighted spikes produce permission w at a pass-through Node, which adds no neurons. A positive control contribution plus k times w counteracts a tonic minus-k drive at the relay neurons. A separate content source drives the relay, which drives a target. In a write circuit, the current-state comparison input needed for the write error is additionally required. Readysignal r Freesignal f Blockerveto signal v Supplied constantoffset −1 Condition populationz = r + f − 1 − v +r+f−v Decodespikes Permission port wpass-through Nodeno neurons Supplied constantblocking drive −k Release drive +kw Contentsource Relay populationcontrolled transmission Targetpopulation Ellipses: neural populations · rectangles: ports or supplied constants

Figure 26: control of one relay. Ellipses are neural populations. The two constant-input rectangles prescribe drives whose neural sources are not modeled. The permission rectangle only passes a signal onward. Permission counteracts blocking at the relay’s neurons. For writing, the relay additionally needs the current-state comparison input from Figure 25. This is a circuit explanation, not a new recording.

What is neural, and what is a Nengo Node?

A nengo.Ensemble contains model neurons. A nengo.Node is an interface or a computation specified by the model builder. It has no membrane potential, firing threshold or spike generator of its own. Calling something a Node does not make it neuronal.

The permission port only passes a signal onward. nengo.Node(size_in=1) receives the weighted, filtered output of the condition neurons and supplies it to another connection. It does not make an additional decision. This port is useful for connecting, branching or observing the signal, but the neural interpretation does not require another population at this point.

The offset −1 is a supplied constant. It changes the condition neurons’ currents through their encoders and gains. The code contains no separate population whose spikes generate that offset. Similarly, the tonic blocking drive is supplied by a constant Node connected to relay.neurons. “Tonic” means that this drive persists; the rectangle is not an inhibitory neuron.

How could these constants be implemented neurally? Their current contributions could be incorporated into target-neuron biases, with tuning and decoding calibrated consistently. A bias summarizes background drive without identifying its biological source. Alternatively, a tonically active population could supply weighted, filtered spikes to approximate the required drive. Permission could counteract that drive or inhibit its source. These are circuit extensions that must be built and checked; neither is implemented merely by drawing a rectangle.

The present circuit combines conditions through neurons and decoded connections, and its relay responds through neurons. Its two constant drives remain explicit modeling assumptions.

Decoding is part of the synaptic connection

A decoded permission does not require a neuron to turn spikes into a written number. Each condition neuron has a fitted decoding weight dᵢ. Combined with the opening strength k and the target neuron’s gain αⱼ, it gives an effective connection weight Wⱼᵢ = αⱼ k dᵢ. Weighted, filtered spikes change the relay neurons’ currents. The numerical description and the neuronal effect describe the same connection.

Condition neurons connect directly to relay neurons A direct connection incorporates the decoding weights. The content input and constant blocking drive from Figure 26 remain required but are omitted here. Condition populationspiking neurons Relay populationspiking neurons weighted, filtered spikesWⱼᵢ = αⱼ k dᵢ

Figure 27: the permission-dependent connection without a pass-through Node. Content input and constant blocking from Figure 26 are omitted from this enlargement, but remain required.

The direct connection below replaces the two connections through the permission port. Nengo fits its function= into weights acting on spikes; this does not insert a Python decision process between the populations. The fitted weights are not automatically restricted to the excitatory or inhibitory sign of a biological cell class.

Three conditions, introduced one at a time

In the word example, ready, free and blocker describe conditions for handling the current or following word. They are control signals, not additional word identities.

Ready (r): the offered item meets a specified readiness criterion. A detection circuit must produce this signal. It indicates that an item can be used; the source buffer separately represents which item it is.

Free (f): the central recurrent buffer is available for the proposed write. In a protected word register, this can require release of the preceding item and confirmation of clearing. It does not refer to the downstream recipient of the read path.

Blocker, or veto (v): a reason to withhold permission is present, such as a temporary pause request. This is an input to the condition population. It is distinct from the earlier block signal b, which directly controls relay inhibition.

The combination z = r + f − 1 − v makes both positive conditions necessary for ideal zero/one inputs. The fixed −1 offset makes one positive condition insufficient. A positive-response population converts sufficiently positive z into a graded permission w.

Intended settled conditions for this write example
SituationReadyFreeVetoPermission
B ready, current A still protected1000
B ready, central buffer available1101
B ready and buffer free, but pause requested1110
Buffer free, offered item not ready0100

These are desired values. Real neural signals fluctuate and take time to settle. The combination requires appropriately bounded input signals; it is not an exact Boolean operation for arbitrary amplitudes. Read permission needs its own conditions, such as a valid current item and a downstream request. A central buffer holding that item need not be free for replacement.

Does a high control signal open or close?

In the earlier relay example, high block b closes the route. Here, high permission w opens it by counteracting tonic inhibition. The combined pre-gain control drive is −k + kw: approximately −k when permission is absent, and approximately zero when permission is present. The connection filter and each relay neuron’s gain also affect the resulting current.

Permission enables the relay to respond to arriving content. It does not carry that content itself. A change in conditions first affects the control population, then permission, then relay current and spikes. Permission onset, gate opening and completed writing are therefore separate events.

The Nengo condition circuit and its relay connection

The first excerpt expects neural sources named ready, free and blocker. The second connects its permission output to an existing relay. The third is an alternative: use it instead of the two connections through the permission port. Keep the constant blocking connection. Adding both release paths would double the intended drive.

Combine the conditions

condition = nengo.Ensemble(240, 1, radius=1.5,
    encoders=np.ones((240, 1)),
    intercepts=nengo.dists.Uniform(0.08, 0.65),
    eval_points=nengo.dists.Uniform(0, 1.5))
nengo.Connection(ready, condition, synapse=0.01)
nengo.Connection(free, condition, synapse=0.01)
nengo.Connection(nengo.Node([-1]), condition,
                 synapse=None)
nengo.Connection(blocker, condition,
                 transform=-1, synapse=0.01)
permission = nengo.Node(size_in=1)
nengo.Connection(condition, permission,
    function=lambda x: np.clip((x[0]-0.2)/0.5, 0, 1),
    synapse=0.005)

Connect through the permission port

k = 5.0
n = relay.n_neurons
tonic_block = nengo.Node([1])
nengo.Connection(tonic_block, relay.neurons,
    transform=-k * np.ones((n, 1)), synapse=None)
nengo.Connection(permission, relay.neurons,
    transform=k * np.ones((n, 1)), synapse=0.01)

Alternative: connect directly to the relay

# Alternative: replace the path through the permission port.
control_filter = nengo.Lowpass(0.005).combine(
    nengo.Lowpass(0.01))
nengo.Connection(condition, relay.neurons,
    function=lambda x: np.clip((x[0]-0.2)/0.5, 0, 1),
    transform=k * np.ones((relay.n_neurons, 1)),
    synapse=control_filter)

The permission Node is a numerical pass-through port. The nonlinear function is fitted into decoding weights acting on condition-population spikes; np.clip specifies the desired decoding function, not an exact runtime clamp. The port-based and direct variants were built separately with Nengo 4.1.0. Their effective decoded weights matched, and the direct filter combines the two intended time constants. This construction check took zero simulation steps; it does not establish identical discrete timing or provide a new behavior recording. No tonic source population has been added.

Read §2.4.6 and Figure 26 · PDF pages 53–58 · Return to §2.4.1: what a gate changes.

EXAMPLE 09 · §2.5.6 · NEURAL ACTION SELECTION

Selecting the naming or repetition pathway

Recorded Nengo simulation

Imagine seeing a cup while hearing someone say Kanne. “Name what you see” calls for TASSE; “repeat what you hear” calls for KANNE. Both word forms can be available at once. Here, a changing task cue determines which source may influence a shared candidate buffer.

This is the small circuit from §2.5.6. It starts at the point where the two word forms are already available: their identities and the task cues are supplied inputs. The simulated part is the neural selection and transmission circuit. Recognizing a picture or sound, retrieving a word, and articulating it are outside this example.

Read §§2.5.6–2.5.7 · PDF pages 65–66 · Nengo code · Recording details

Task selection enables one of two content pathwaysA neural task buffer supplies scalar utilities to a basal-ganglia network. Its inhibitory output controls thalamic action populations. The selected action suppresses the blocking population of its route. Naming and repetition sources continuously represent TASSE and KANNE. Their separate gated channels converge on a candidate buffer with no recurrent feedback. The wait action has no content route. CONTROL: which action should enable a route? Task bufferNAME / REPEAT / IDLE utilities Basal gangliathree action channelsname · repeat · wait inhibition Thalamic actionsselected action becomes active name inhibits its blockerrepeat WORD CONTENT Naming sourceTASSE Heard-form sourceKANNE Name blocker40 LIF neurons Repeat blocker40 LIF neurons Naming channel32-D spiking relay Repetition channel32-D spiking relay inhibitsinhibits Candidate bufferno recurrent feedback WAIT has no content route.Both blockers remain active.

Ellipses denote neural populations or buffer ensembles; the rounded boxes group the basal-ganglia and thalamic action populations. Lines ending in a bar indicate an inhibitory effect. Each route has its own blocking population and its own content relay. The word vectors travel through the lower paths, not through the basal ganglia. Supplied input Nodes and observation probes are omitted from this overview.

Action selection chooses

The task buffer generates a utility for naming and a utility for repetition. A third action, waiting, has a fixed baseline utility of 0.5. With the IDLE cue, neither word-routing action is sufficiently supported, so waiting wins. These utilities are control values, not word contents.

Local gates implement the choice

The selected basal-ganglia output becomes less inhibitory. Its thalamic action population becomes active and suppresses that route’s blocker. With blocking reduced, the channel neurons can respond to their source. A high blocker signal closes a route; high thalamic action activity helps open it.

— / 2.800 s

Loading the recorded simulation…

Inspect:

Playback of saved neural activity. These buttons move the viewing cursor; they do not change the task sequence or run a new simulation.

AT THE CURRENT CURSORLoading…

Naming blocker—High activity suppresses the naming channel
Repetition blocker—High activity suppresses the repetition channel
Naming channelSpikes in the route carrying TASSE
Repetition channelSpikes in the route carrying KANNE

Dots show the same 12 consecutive cells per population as the rasters below. Each stays lit for 25 ms after a recorded spike. Brightness is not membrane voltage. The blocker readouts use all 40 neurons per blocker; the channel samples are the first 12 of 30 cells in each first subensemble, not the complete vector representation.

Decoded content at — · dot product with each reference pointer
BufferTASSEKANNE
Name / TASSERepeat / KANNEWait
A · Utilities arriving at the selection circuitName, repeat, wait
B · Basal-ganglia outputSelected channel becomes less negative
C · Thalamic action activitySelected action becomes active
D · Blocking-population spikes12 cells per blocker · active closes
E · Content-channel spikes12 cells per first subensemble
F · Candidate content after neural routingDot product with TASSE and KANNE

All panels share the same time axis. Task changes occur at 0.7, 1.4 and 2.1 s; the shaded interval is the supplied IDLE cue. Continuous curves are decoded signals with 10-ms observation filters. Raster marks are original spike events. The task cue changes first; neural selection, gating and the candidate readout then settle over time.

Follow one selection through the circuit

  1. Task: NAME supports the naming action. In panel A, its utility is highest.
  2. Selection: the naming channel of the basal-ganglia output becomes less inhibitory (B), allowing naming activity in the thalamus (C).
  3. Gate: that thalamic activity suppresses the naming blocker. Its sampled spikes disappear (D). The repetition blocker remains active.
  4. Content: naming-channel neurons can now respond to TASSE (E), and the candidate buffer develops a pattern whose readout matches TASSE (F).

The same chain switches to the heard-form route under REPEAT. The source buffers remain available, as the content table shows. The gate controls which source influences the candidate; it does not delete the unselected source.

What does waiting do?

The wait action has no content-transmission effect. Both blockers stay active, and both word routes are suppressed. The candidate has feedback=0, so its previous activation decays when input ends. This is not an explicit clear command and not a protected recurrent word register. Writing, holding and clearing a recurrent register require the additional circuitry described in §2.4.5 and Chapter 3.

What the saved readouts show

Mean candidate dot products in four settled windows of this one recording
Task and window (s)TASSEKANNEEnabled route
NAME · 0.35–0.600.913−0.224Naming
REPEAT · 1.05–1.30−0.1850.910Repetition
IDLE · 1.75–2.00−0.002−0.003Neither
NAME · 2.45–2.700.913−0.224Naming

The two word pointers in this small vocabulary have a dot product of −0.211. A negative nonmatching trace therefore does not mean negative firing, a semantic opposition between the words, or failed selection. The values are weighted population readouts, not probabilities. The vocabulary here identifies word forms; it does not model their conceptual similarity.

The Nengo selection circuit in a few lines

The task schedule is NAME for 0–0.7 s, REPEAT for 0.7–1.4 s, IDLE for 1.4–2.1 s, and NAME for 2.1–2.8 s. The function supplied to spa.Transcode is:

def task(t):
    return "NAME" if t < .7 or t >= 2.1 else (
        "REPEAT" if t < 1.4 else "IDLE")

The following is the network construction from the recorded script, with indentation adjusted for display. It requires import numpy as np, import nengo and import nengo_spa as spa.

control_vocab = spa.Vocabulary(32, pointer_gen=np.random.RandomState(251))
control_vocab.populate("NAME; REPEAT; IDLE")
word_vocab = spa.Vocabulary(32, pointer_gen=np.random.RandomState(252))
word_vocab.populate("TASSE; KANNE")
with spa.Network(seed=250, label="Task-dependent word routing") as model:
    model.config[spa.State].neurons_per_dimension = 30
    model.config[spa.State].feedback = 0
    control = spa.State(vocab=control_vocab, label="Task cue")
    lexical = spa.State(vocab=word_vocab, label="Naming path")
    heard = spa.State(vocab=word_vocab, label="Repetition path")
    candidate = spa.State(vocab=word_vocab, label="Candidate")
    spa.Transcode(task, output_vocab=control_vocab) >> control
    spa.Transcode("TASSE", output_vocab=word_vocab) >> lexical
    spa.Transcode("KANNE", output_vocab=word_vocab) >> heard
    with spa.ActionSelection() as actions:
        spa.ifmax("name", spa.dot(control, spa.sym.NAME),
                  lexical >> candidate)
        spa.ifmax("repeat", spa.dot(control, spa.sym.REPEAT),
                  heard >> candidate)
        spa.ifmax("wait", 0.5)

spa.State creates neural buffer ensembles. spa.Transcode supplies externally specified vectors through Nodes; these input generators are not spiking populations. The task and word vocabularies are distinct. All four states have zero recurrent feedback.

spa.dot(control, spa.sym.NAME) specifies a scalar task-match signal. Within spa.ActionSelection, each spa.ifmax defines a utility and its possible routing effect. NengoSPA constructs the basal-ganglia, thalamic action, blocking and content-channel populations. The call does not execute a Python “winner” test at every simulated time step. The effect lexical >> candidate is conditional here because it is inside that action-selection context. By itself, outside this context, the same routing notation describes an unconditional connection.

The three rules specify enduring condition–effect relations for this demonstration. They are not learned during the run. This isolated teaching circuit does not imply that the existing Concept-to-Articulation model implements its local gates with basal ganglia.

Read the complete executed Python source · Download source, saved neural arrays and checks (ZIP)

Background: the official NengoSPA ActionSelection documentation explains the utility-and-effect construction; the NengoSPA introduction illustrates conditional routing. The versions used for this recording are specified below.

How this example was recorded

This replays the existing recording underlying the manuscript example: 2.8 seconds, 7,490 LIF neurons, Nengo 4.1.0 and NengoSPA 2.0.0. Network seed: 250; task and word vocabulary seeds: 251 and 252. The four buffers use 32-dimensional vectors and 30 neurons per dimension. Each route has a 40-neuron blocking population and a 960-neuron content channel. The remaining neurons implement basal-ganglia and thalamic action populations.

The two content-channel rasters each show cells 1–12 of the first 30-neuron subensemble. The two blocker rasters show cells 1–12 of each 40-neuron population. Consecutive cells were chosen independently of observed firing rates. The complete NPZ archive also contains all recorded GPi and thalamic-action spikes, the first 480 of 960 neurons in each content channel, all 40 neurons in each blocker, decoded states and reference vectors. It does not record every neuron in every buffer.

Integration and recording use 1-ms steps. The browser preserves all 2,800 samples and the selected cells’ original spike events; no synthetic spikes, interpolation of neural activity, or artificial noise are added. Display dots persist for 25 ms solely to make individual events visible. Decoded probes have 10-ms low-pass filters; these observation filters should not be confused with the model’s connection filters.

The blocking populations receive a constant drive from a bias Node. Thalamic action activity counteracts that drive through an inhibitory connection to its blocker. This constant input, the externally scheduled task cues and the fixed waiting utility are modeling inputs, not additional simulated spiking sources. The overview diagram omits them to keep the two paths visible; the archived source and NengoSPA construction specify them.

The archive was generated with SciPy absent, so the installed basal-ganglia implementation used the global default LstsqL2 decoder solver. The inhibitory roles in the explanatory diagram describe effective population connections; this example does not establish neuron-by-neuron biological sign constraints. The exact executed source, file hashes, settings and checks are retained in the download.

The existing checks confirm the expected dominant thalamic action in each settled window, sustained availability of both sources, passage of the selected identity, blocking of the unselected route and suppression of both routes while waiting. These are local circuit observations, not a performance study of the complete speech model. This website addition converts the saved arrays for playback; it does not rerun the neural simulation.

Browser recording, settings and checks (JSON) · Saved arrays and reproducible source (ZIP) · Static six-panel figure · Reproduction notes · PDF Appendix A.6

The next foundation, §2.6 · Oscillators and gestures, asks how an enabled process unfolds over time. Continue with example 10 below.

EXAMPLE 10 · CHAPTER 2.6 · OSCILLATORS AND GESTURES

One syllable cycle, two gesture ramps

Recorded Nengo simulation

One brief start impulse recruits a neural oscillator. Two fixed connections read different parts of its cycle: one drives a lip-closure gesture, the other a vowel gesture. Each gesture has its own recurrent activation circuit. Together they form a reduced /ba/-like example.

Both gesture routes are permanently permitted. There is no selection between syllables here. The recording stops at gesture activation: it does not simulate lip displacement, tongue shape, voicing or the sound of /ba/. This keeps the relation between oscillator phase and gesture dynamics visible.

Read the expanded Chapter 2.6 · Nengo code · Recording details

One oscillator with two permanently connected phase-drive and ramp circuitsA supplied start impulse drives a recurrent two-dimensional oscillator. Different fitted decoders connect it to lip and vowel phase-drive populations. Each drive population feeds its own recurrent gesture activation. Lip scaling is 0.20, vowel scaling 0.05; both ramps use a five-millisecond synaptic time constant. Supplied kick0.15–0.20 s · 0.5 Oscillator2,500 LIF · (x₀, x₁) rotation + cutoff Lip phase drive200 LIF Vowel phase drive200 LIF 54.0°–155.4°105.4°–257.5° Lip activation1,000 LIF Vowel activation1,000 LIF k = 0.20 k = 0.05 Separate bounded feedback(1 − k) · min(0.9, a)

Fixed weights continuously connect the populations. Two fitted oscillator readouts generate phase-dependent drive; no runtime instruction calls “start lip” or “start vowel”. The start rectangle is a supplied Node. Every ellipse contains LIF neurons. There are 4,900 neurons in total.

— / 1.600 s

Loading the recorded simulation…

Inspect:

Replay of one saved 1.6-second neural simulation. The moving dot follows the decoded oscillator coordinates. Controls change the viewing time, not the model.

AT THE CURRENT CURSORLoading…

● Window start · □ Window end. Phase begins at the left and increases counterclockwise through the lower half. The grey circle is a reference; the dark trajectory and green moving dot are recorded neural readouts. The small central disk marks radius below 0.3, where phase is unreliable.

SAME MOMENT · SEPARATE STATES

Decoded phase: —
Oscillator radius: —
Supplied kick: —

Lip phase drive—
Lip activation—
Vowel phase drive—
Vowel activation—

Bars use a 0–1 display scale. Numbers and curves retain the original decoded values, including small negative fluctuations or values above one. These are activation signals, not articulator positions.

A phase boundary starts or ends the drive

The lip window spans 54.0°–155.4°; the vowel window spans 105.4°–257.5°. Their overlap means both drive signals can be present together. The specified window starts do not instantly set the corresponding ramps to their maximum. The specified window ends do not erase the state already accumulated in the ramps.

The desired decoder output is zero below radius 0.3. Outside that central region, it is positive inside the gesture’s phase window and zero elsewhere. Nengo fits this function into connection weights acting on oscillator spikes. Actual transitions are approximate and filtered, rather than exact angle tests during the simulation.

Lip closureVowel activationStart impulse
A · The supplied start impulse0.5 from 0.15 to 0.20 s
B · Neural phase-drive populationsDifferent decoding weights
C · Recurrent gesture activationsLip rises and decays faster

Dashed lines mark the phase-window starts; dotted lines mark their ends, inferred from the filtered oscillator recording. These are reference markers, not commands. A smoothed neural readout can begin rising before a nominal boundary. All decoded observation probes use 10-ms filters; spike events are unfiltered.

What makes a ramp rise?

The ramp receives current phase drive, scaled by k, together with its own bounded recurrent feedback, scaled by 1 − k. Arriving weighted spikes change its population pattern. Recurrence makes its decoded activation develop gradually. “Starting” means adding drive, not switching every neuron on at once.

What makes it fall?

After phase drive ends, the feedback gain below one cannot sustain the positive state indefinitely. Activation decays. This is a leaky, bounded activation circuit, unlike an ideal integrator that would hold with zero input. Its curve is generally an exponential rise and fall, not a perfectly straight ramp.

Why the consonant and vowel have different trajectories

Both ramp connections use 5-ms synaptic filters. The lip circuit uses k = 0.20; the vowel circuit uses k = 0.05. Below the feedback bound, an idealized continuous description gives an effective time constant of 5 ms / k: 25 ms for lip closure and 100 ms for the vowel. The actual curves also include the changing neural drive, finite-population effects and observation filtering.

The bound 0.9 limits the desired recurrent contribution, not total activation. External drive can lift activation above it. The original parameter name velocity denotes this connection scaling, not a measured lip or tongue velocity. A gesture activation determines influence on a target; the target and articulatory mechanics are additional parts of a speech model.

Oscillator
Lip drive
Lip ramp
Vowel drive
Vowel ramp

First 20 cells of each population. A dot stays lit for 25 ms after a recorded spike; brightness is not voltage. Ramp neurons can fire even near decoded zero.

Inspect the five neural spike patterns
Oscillator · cells 1–20 of 2,500
Lip phase drive · cells 1–20 of 200
Lip activation · cells 1–20 of 1,000
Vowel phase drive · cells 1–20 of 200
Vowel activation · cells 1–20 of 1,000

The same saved time and cursor apply to all five rasters. Cells were selected consecutively, before inspecting their firing patterns. The download retains all 4,900 spike trains.

Local timing in this recording

Threshold 0.2, sustained for 20 ms; decoded observation signals
GestureDrive onsetActivation onsetDrive releaseActivation release
Lip closure0.259 s0.279 s0.480 s0.509 s
Vowel0.358 s0.396 s0.666 s0.793 s

Both activation readouts exceed 0.2 together for 113 ms. The vowel takes 127 ms after its drive-release marker to fall below the same threshold; the lip takes 29 ms. These threshold-defined observations describe this small circuit, not whole-model performance or universal consonant and vowel durations.

The Nengo oscillator and two ramps in a few lines

Inside the Nengo network, the start input and oscillator are built as follows. The complete executed script supplies imports, fixed windows, probes, simulation and figure generation.

kick = nengo.Node(lambda t: .5 if .15 <= t < .20 else 0.)
oscillator = nengo.Ensemble(2500, 2,
    intercepts=nengo.dists.Uniform(.3, 1))
nengo.Connection(kick, oscillator,
                 transform=[[-1], [0]], synapse=.005)

def cutoff(x):
    return np.zeros(2) if np.arctan2(x[1], x[0]) > 7.5/8*np.pi else x

tau = .025
omega = 2*np.pi*1.5
nengo.Connection(oscillator, oscillator, function=cutoff,
    transform=[[1, -tau*omega], [tau*omega, 1]], synapse=tau)

def phase_drive(x, window):
    if np.dot(x, x) < .09:
        return 0.
    p = np.arctan2(x[1], x[0]) / (2*np.pi) + .5
    return window[2] if window[0] <= p < window[1] else 0.

windows = {"lip": (.15, .431707317073, 1.),
           "vowel": (.292682926829, .715243902439, .95)}
for name, window in windows.items():
    pulse = nengo.Ensemble(200, 1,
        intercepts=nengo.dists.Uniform(.02, 1))
    nengo.Connection(oscillator, pulse,
        function=lambda x, w=window: phase_drive(x, w), synapse=.005)
    ramp = nengo.Ensemble(1000, 1)
    k = .20 if name == "lip" else .05
    nengo.Connection(pulse, ramp, transform=k, synapse=.005)
    nengo.Connection(ramp, ramp, transform=1-k,
        function=lambda x: min(.9, x[0]), synapse=.005)

The functions specify targets for fitted connection weights; they are not separate runtime angle-checking Nodes. The oscillator cutoff changes its own recurrence above 348.75°. It does not directly clear the ramp populations. They decay according to their own state and feedback.

Read the exact executed source · Download source, full recording, figures and checks (ZIP)

How this example was recorded

One final isolated teaching run: Nengo 4.1.0, NumPy 2.5.4, seed 11, 4,900 LIF neurons, 1-ms integration and recording, duration 1.6 s. The nominal oscillator frequency is 1.5 Hz. Oscillator recurrence uses 25 ms; all other connections use 5 ms. Decoded probes use an additional 10-ms observation filter. All 1,600 original samples are replayed; no artificial noise or synthetic spikes were added.

The phase windows and bounded-ramp rules follow the archived pathway. A preliminary diagnostic with kick amplitude 1 pushed the oscillator outside its nominal representation radius and caused unwanted startup transients. The final run shown here reduces the supplied kick to 0.5. This local shaping check is documented in the manuscript; it is not a new production study.

The oscillator and phase-drive intercepts are uniform on [0.3, 1] and [0.02, 1], respectively. Ramps use default intercepts; all ensembles have radius 1, default LIF membrane dynamics and default maximum-rate distributions. The NPZ download retains every recorded decoded trace and all spike trains. The JSON retains all continuous samples and the displayed 20 cells per population.

Angular markers are interpolated crossings of the filtered oscillator readout while its radius exceeds 0.3. Drive and ramp onset/release markers instead use a sustained amplitude threshold. These measurements should not be equated. The geometric ring is a reference, not a replacement for the neural trajectory.

Browser recording and metadata (JSON) · Original neural recording and source (ZIP) · Static drive and ramp figure · Reproduction notes in Appendix A.7

Readiness, permissions and next-syllable requests are introduced later in Chapter 4 · From syllable to articulation. This example establishes the fixed oscillator-to-gesture circuit first.