-
Notifications
You must be signed in to change notification settings - Fork 1
Checkpointing
Added on main via LIM-234 / GH#28 (save_state / load_state!).
snap = save_state(router::RegionRouter) # -> NamedTuple (independent copies)
load_state!(router, snap) # in-place restore
load_state(router, snap) # alias of load_state!save_state copies:
| Field | Purpose |
|---|---|
n_regions, n_out
|
Dimension validation |
region_names |
Structural match check |
adjacency_matrix |
Structural match check |
inhibition_matrix |
Structural match check |
routing_weights |
Restored |
readout_ema |
Restored |
spike_density |
Restored |
prev_routing_weights |
Restored |
prev_relevance |
Restored |
surprise |
Restored |
scratch |
Restored (optional on older snaps) |
tick_count |
Restored |
Array fields are copy so later update_routing! does not mutate the snapshot. Element types are immutable (Float32 / String).
load_state! throws ArgumentError when:
-
n_regions/n_outmismatch the target router - required structural fields missing (
region_names,adjacency_matrix,inhibition_matrix) - array sizes wrong
-
region_names/ adjacency / inhibition values do not equal the target router
Structural fields are validated, not rewritten — the target router must already be configured for the same experiment labels and graph.
If scratch is absent from an older snapshot, the load path zeros the target scratch buffer for determinism.
- Pause / resume long-running routing experiments
- Round-trip tests
- Reproducible restarts when the surrounding SNN state is also restored
Not a wire format or cross-language serialization standard — it is a Julia NamedTuple of copies. Callers that need disk I/O should serialize the snapshot themselves.
See test/test_nero.jl suites: round-trip, dimension mismatch, structural mismatch, load_state alias.
Last updated: July 29, 2026
Updated by: Grok Build: Grok 4.5
Package tip reference: c9ff99c (main)