-
Notifications
You must be signed in to change notification settings - Fork 0
STDP and Covariance

Generated with Grok Build: Grok 4.5 · xAI Imagine (/imagine)
Plasticity and statistics paths in sparse_brain.jl.
| Constant | Value | Role |
|---|---|---|
ETA |
0.001 | Default learning rate (reflex_eta default) |
TAU_TRACE |
20.0 | Eligibility-trace decay time |
TAU_SPIKE |
20.0 | Documented STDP time constant (design note) |
W_MAX |
1.0 | Clamp on W_out after updates |
Conceptual covariance / STDP framing used in docs:
ΔW_ij = η (⟨s_i s_j⟩ − ⟨s_i⟩⟨s_j⟩)
Bi & Poo (1998); Hebb (1949)
After spikes are written:
trace_pre ← trace_pre * (1 − DT/TAU_TRACE) + S
trace_post ← trace_post * (1 − DT/TAU_TRACE) + S
Traces live as CuVector{Float32} of length N on each SparseBrain.
Recurrent sparse W is not rewritten each step on the hot path. The implemented online plasticity updates W_out:
when tick_count % 10 == 0:
S_out = (output .> 0)
dW_out = reflex_eta * (S_out * trace_pre')
W_out += dW_out
clamp!(W_out, -W_MAX, W_MAX)
reflex_eta can be elevated on the Fast ensemble lobe under reflex gating (5×). See Inhibition and Reflex Gating.
Offline / diagnostic-style statistic over the rolling spike history:
result = compute_reservoir_covariance!(brain)
# nothing until history has wrapped once (hist_full)
# else (C::CuMatrix, indices::Vector{Int})Algorithm:
- Require
brain.hist_full(at leastHIST_DEPTHticks recorded). - Draw
COV_SUBSAMPLE(8192) random neuron indices. - Slice
X = history[:, indices]→ size1000 × 8192on GPU. - Mean-center columns.
- Form covariance
C = (X' X) / (HIST_DEPTH - 1)(dense GEMM / SYRK-class workload).
Full N×N at N=65,536 and Float32 would be:
65536² × 4 bytes ≈ 17 GB
which does not fit a 16 GB card. Subsampled:
8192² × 4 bytes ≈ 268 MB
while still stressing GPU tensor throughput for diagnostics or downstream analysis.
| Field | Role |
|---|---|
history |
HIST_DEPTH × N Float32 spikes on GPU |
hist_idx |
Next write row (1-based circular) |
hist_full |
true after first wrap |
Each step: history[hist_idx, :] .= S, then advance index.
Older design notes / Devin outline text mention background Geometric Brownian Motion path generation. That generator is not present on current main after domain decoupling. Consumers who need synthetic time series should generate them outside LiquidCortex and feed CuVector{Float32} inputs.
Last updated: July 28, 2026
Updated by: Grok Build: Grok 4.5
Package tip reference: 4e2698c (main)