CTRNN Learning Playground

Explore continuous-time recurrent neural-network dynamics interactively.

Simulation mode — no training
τ dh/dt = −h + f(Wrech + Winx)
The hidden state h(t) changes continuously according to recurrent input, external input, the activation function, and the time constant τ.
Simulation clock t = 0.00 s Simulation time, not wall-clock time.
How to read the model: x(t) = external stimulus/input, h(t) = recurrent hidden-state population, y(t) = readout/output.
Blue connection = positive weight, orange connection = negative weight, thicker line = larger |weight|.

1. External input x(t)

These are signals coming from outside the recurrent population. In neuroscience, they can represent cues, sensory evidence, task signals, or injected drive.

Iext(t) = Winx(t)
What do Constant, Step, Pulse and Sine mean?

Constant: x(t)=A for the whole run.

Step: x(t)=0 before the start time, then x(t)=A afterward.

Pulse: x(t)=A only between start and end.

Sine: x(t)=A sin(2πf(t−tstart)) within the chosen interval.

2. Recurrent hidden population h(t)

These units form the dynamical system. Each hidden unit is influenced by external input and by the current activity of the recurrent population.

4 hidden units
4
τ dhi/dt = −hi + f(Σⱼ Wrecijhj + Σₖ Winikxk)

Initial hidden state h(0)

These values determine where the neural population begins in state space.

Selected connection

Click a connection in the network.

Select any line to inspect and change its weight.

0.0
What do the three connection types mean?

x → h: input weight in Win. It controls how strongly an external input affects a hidden unit.

h → h: recurrent weight in Wrec. It controls how hidden units influence one another over time.

h → y: readout weight in Wout. It controls how hidden activity contributes to the output.

3. Output / readout y(t)

The output is not another recurrent state. It is a readout from the current hidden population.

y(t) = Wouth(t)
What is a linear readout?

Each output is a weighted sum of the hidden-state activities. For one output:

y = w₁h₁ + w₂h₂ + … + wₙhₙ

4. Fixed-point & stability analysis

A fixed point h* is a state where the dynamics stop changing:

dh/dt = 0
Set x(t)=0

Remove all external drive and ask: where does the recurrent network settle by itself?

Hold current x(t) constant

Freeze the present input and ask: if that input stayed forever, where would the network settle?

Fixed point h*

Not analyzed yet.

At h*, the vector field is approximately zero.

Stability

Not analyzed yet.

Stable: nearby trajectories return. Unstable: at least one nearby direction moves away.

Jacobian eigenvalues

Not analyzed yet.

Negative real parts imply local decay toward the fixed point.

How does the Jacobian determine stability?

Near a fixed point, the nonlinear system is approximated by a linear system:

dδh/dt ≈ J δh

If every eigenvalue of J has a negative real part, small perturbations decay and the fixed point is locally stable.

5. Neural activity over time

Solid lines show hᵢ(t). Dashed gray lines show xᵢ(t).

Flat hidden-state curves indicate that the system may be approaching a steady state.

6. Population trajectory

Raw population view: h1 versus h2

PCA is computed after Pause or when the run ends.
Start End/current state + Fixed point (raw view only)
What does the trajectory mean?

The hidden population has one coordinate per hidden unit. With four hidden units, h(t) lives in 4D state space.

The raw view shows h₁ against h₂. The PCA view projects the full hidden-state trajectory into two principal components.