JOVANA
Explore Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Structure and Interpretability: Switching, Koopman, and SINDy

If a black box can fit the data, why do scientists still chase interpretable dynamics? Because a model you can read tells you which computations the brain is actually running — a family of methods built to trade a little flexibility for a lot of insight.

Switching dynamics: SLDS and rSLDS

Behavior is often piecewise: reach, then hold; explore, then commit. A switching linear dynamical system (SLDS) captures this by letting a discrete latent state select which of several simple linear dynamics is active at each moment. The result is a globally nonlinear model assembled from locally linear, human-readable regimes — you can literally name the states. The recurrent SLDS (rSLDS) sharpens this by letting the continuous state itself influence when switches happen, carving state space into dynamically distinct regions.

z_{t} \sim \mathrm{Markov}(\pi),\qquad x_{t+1} = A_{z_{t}}\,x_{t} + b_{z_{t}} + w_{t},\qquad y_{t}\sim p(\cdot\mid x_{t})

An SLDS: a discrete regime zₜ evolves as a Markov chain and indexes which linear dynamics (A, b) governs the continuous state xₜ. Simple, nameable pieces compose into rich global behavior.

Koopman and DMD: linearity, regained

There is a deep and surprising alternative to modelling nonlinearity head-on. Koopman operator theory says: leave the nonlinear system alone, but lift it into a richer space of observable functions where its evolution becomes exactly linear — at the price of that space being infinite-dimensional. In practice you learn a finite set of observables and a linear operator on them; dynamic mode decomposition (DMD) is the data-driven workhorse that estimates it, yielding modes with clean frequencies and growth rates.

(\mathcal{K}\,g)(x) = g\!\bigl(F(x)\bigr) \quad\Longrightarrow\quad g\!\bigl(x_{t+1}\bigr) = (\mathcal{K}\,g)\!\bigl(x_{t}\bigr)

The Koopman operator 𝒦 advances observables g of the state linearly, even when the underlying flow F is nonlinear. Its eigenfunctions give coherent spatiotemporal modes — the appeal is a linear-algebra handle on nonlinear dynamics.

Whether via switching regimes, Koopman modes, or fixed-point analysis, the goal is the same: read interpretable structure — rotations, attractors, transitions — off the trajectories on the manifold.

SINDy: recovering the equations

The most ambitious interpretable method tries to write down the governing equation itself. Sparse identification of nonlinear dynamics (SINDy) builds a large library of candidate terms — polynomials, sinusoids — of the state and solves a sparse regression for the few that actually predict the derivative. When it works, the output is not a weight tensor but a short, legible system of ODEs. The catch is severe: it needs clean estimates of the state and its derivative, and the true law must lie in your chosen library.

\dot{X} = \Theta(X)\,\Xi, \qquad \hat{\Xi} = \arg\min_{\Xi}\; \bigl\lVert \dot{X} - \Theta(X)\,\Xi \bigr\rVert_{2}^{2} + \lambda\,\lVert \Xi \rVert_{1}

SINDy: Θ(X) is a library of candidate functions of the state; the ℓ₁ penalty forces the coefficient matrix Ξ to be sparse, so only a handful of terms survive into an interpretable equation of motion.

Reading structure back out

Even with a black-box RNN, you are not helpless. Fixed-point analysis numerically locates the states where the learned flow vanishes and linearizes around them, revealing the attractors, line attractors, and saddles the network uses to compute — a decision, for instance, often appears as a saddle separating two stable choices. Combined with rotational (jPCA) structure and the trajectory-tangling principle, these tools let you extract mechanism from an otherwise opaque model.