Skip to main content

Module wong_wang

Module wong_wang 

Source
Expand description

Batch parity with WongWangUnit.step in src/sc_neurocore/neurons/models/wong_wang.py (Wong & Wang 2006, J. Neurosci. 26:1314โ€“1328).

Per step:

  1. i_k = j_n * s_k - j_cross * s_(3-k) + i_0 + stim_k + sigma * xi
  2. r_k = phi(i_k) where phi(i) = (a*i - b) / (1 - exp(-d*(a*i - b))) with singularity guard |a*i - b| < 1e-6 -> 1/d.
  3. s_k += (-s_k/tau_s + (1 - s_k) * gamma * r_k) * dt
  4. clamp s_k into [0, 1].

The Python primary draws np.random.randn() twice per step; the Rust simulator takes xi pre-drawn from the Python RNG so trajectories are bit-exact for matching seeds. This mirrors the ping.rs + PINGCircuit pattern: Python owns the RNG, Rust owns the inner loop.

Constantsยง

A ๐Ÿ”’
B ๐Ÿ”’
D ๐Ÿ”’

Functionsยง

phi ๐Ÿ”’
simulate
Simulate n_steps Wong-Wang iterations; write per-step state + firing-rate traces. xi must be length 2 * n_steps (two noise samples per step, consumed in i1, i2 order).