CLI
Run simulations, replay inputs, train networks and load checkpoints from the command line.
The simulator can run from a terminal as well as through the Python API. After installing snnlab, use either entry point:
python -m snnlab.sim --help
snnsim --helpBoth call the same implementation. In a project managed by uv, prefix commands with uv run. All execution commands require an explicit --out-dir.
Commands and executors
| Command | Purpose |
|---|---|
sim | Simulate; use --load-weights to load parameters, and --infer for legacy test-set evaluation. |
train | Train using graph inputs and a bundle recipe, or the legacy dataset workflow. |
dump-weights | Export initialized and trained legacy weight matrices without a forward pass. |
python -m snnlab.sim sim --help
python -m snnlab.sim train --help
python -m snnlab.sim dump-weights --helpThe CLI defaults to --executor legacy, unlike the ExecutionSpec library API, which defaults to graph execution. Use --executor graph --bundle network.bundle for networks authored with snnlab.lang. Graph execution requires exactly one input source: --input-file, --event-file, --poisson-protocol or --dataset-file. The available source flags depend on the command: generated Poisson and sparse event inputs are available on sim; train accepts dense replay or dataset snapshots.
Complete graph simulation
Save this as build_network.py in your working directory. It compiles the same small excitatory network used in Quickstart and writes a bundle for the CLI:
from snnlab import lang
net = lang.Network("cli-example", dt=0.1 * lang.ms)
inputs = net.input(
"inputs", shape=("time", "batch", 4), signal_type="spikes", unit="spike"
)
cells = net.population("E", size=16, neuron=lang.COBA_LIF(tau_mem=20 * lang.ms))
net.connect(
inputs,
cells.excitatory,
name="input_to_E",
synapse=lang.AMPA(tau=2 * lang.ms),
weight=lang.Uniform(0.1, 0.5),
constraint=lang.NonNegative(),
)
net.output("spikes", cells.spikes)
net.expose(inputs, name="input_spikes")
net.expose(cells.voltage, name="e_voltage")
lang.compile(net, target="tools/snnsim").write("network.bundle")Compile it, then generate 300 ms of input spikes at 80 Hz for one presentation:
python build_network.py
python -m snnlab.sim sim \
--executor graph --bundle network.bundle \
--poisson-protocol fixed-rate --input-rate 80 \
--t-ms 300 --n-batch 1 --seed 17 --device cpu \
--out-dir runs/poissonThe bundle supplies the timestep, topology and input dimensions. --t-ms sets duration in milliseconds; it must align with the bundle timestep. --input-rate is in Hz. For a categorical rate protocol, replace the protocol/rate flags with --poisson-protocol categorical-rate --input-rates 5 25 80; one listed rate is selected independently for each presentation. CLI Poisson generation requires exactly one declared spike input.
Graph runs write the following files, including after training:
| File | Contents |
|---|---|
outputs.npz | Named graph outputs. |
recording.npz | Exposed diagnostics; empty when disabled with --no-diagnostics. |
parameters.npz | Named parameter arrays. |
metrics.json | Execution metrics and input provenance; training also includes update/epoch metrics. |
inference-manifest.json | Digests and array metadata for the saved artifacts. |
Inspect the simulation output:
import numpy as np
with np.load("runs/poisson/outputs.npz", allow_pickle=False) as outputs:
spikes = outputs["spikes"]
print(spikes.shape) # (3000, 1, 16): time, batch, cells
print(int(spikes.sum()))Graph execution saves arrays and metrics; it does not automatically produce figures. Use snnlab.viz to plot them.
Replay and dataset inputs
For the bundle above, create a binary replay array and run it:
import numpy as np
spikes = np.zeros((100, 1, 4), dtype=np.float32)
spikes[::10, 0, 0] = 1
np.savez("inputs.npz", inputs=spikes)python -m snnlab.sim sim \
--executor graph --bundle network.bundle --input-file inputs.npz \
--device cpu --seed 17 --out-dir runs/replayNPZ keys must match declared input IDs and cover every input exactly once. A NPY array can bind a graph with one input. Dense replay determines its own step and batch counts; the bundle supplies the timestep. The example runs for 10 ms. Sparse replay uses --event-file events.npz; see the event binding contract for coordinate rules.
Dataset snapshots use --dataset-file snapshot.npz together with --dataset-encoder rate-poisson, prebinned-spikes or event-bin. Supply --input-dataset-id and --input-split for provenance. Use --dataset-input-id to select the declared input; it is inferred only for a graph with one input. Feature and label keys default to features and labels; override them with --dataset-feature-key and --dataset-label-key. These commands consume local snapshots and do not download a dataset. See DatasetSnapshotBinding for shapes and encoder requirements.
Graph training and checkpoints
Training requires a bundle with an authenticated training recipe, such as one compiled in the Training example. The simulation-only bundle above has no recipe. Given a training bundle, dense inputs and integer class targets, run:
python -m snnlab.sim train \
--executor graph --bundle classifier.bundle \
--input-file train-inputs.npz --target-file train-targets.npz \
--epochs 3 --batch-size 32 --input-shuffle --seed 17 --device cpu \
--save-final-checkpoint runs/train/final.checkpoint \
--save-selected-checkpoint runs/train/selected.checkpoint \
--out-dir runs/trainThese filenames stand for prepared training data: input NPZ keys match graph input IDs, target NPZ keys match recipe target IDs, and each target has one integer label per sample. A target NPY is accepted when the recipe has one target. Alternatively, use a dataset snapshot with --dataset-target-id instead of separate input/target files.
The bundle recipe controls the graph optimizer, learning rate and trainable parameters; legacy flags such as --lr do not replace that recipe. Positive --epochs enables minibatch iteration. With graph execution, --epochs 0 performs one full-batch update; the legacy executor uses zero epochs as a probe without training. The selected checkpoint uses the lowest update loss.
Resume graph training by adding --load-weights runs/train/final.checkpoint and increasing the requested total epoch count. Keep the bundle, training data, seed and iteration settings compatible with the checkpoint. Load trained parameters for simulation with:
python -m snnlab.sim sim \
--executor graph --bundle classifier.bundle \
--input-file test-inputs.npz --load-weights runs/train/final.checkpoint \
--device cpu --seed 17 --out-dir runs/inferenceGraph simulation loads parameters without restoring the optimizer or training iterator. It does not require --infer, and does not automatically compute legacy test-set accuracy. See checkpoint compatibility.
Graph controls
| Flag | Behaviour |
|---|---|
--device auto, cpu, cuda, cuda:N, mps | Select the execution device; default auto. |
--seed N | Seed initialization and generated inputs. |
--no-diagnostics | Disable exposed diagnostic collection; named outputs remain available. |
--save-runtime-state DIR / --load-runtime-state DIR | Save or restore dynamic simulation state, including neuron, synapse and delay state. Separate from weight checkpoints. |
--scale-projection ID=FACTOR | Scale a named projection for this simulation; repeatable. |
--intervention drop:POPULATION=PROBABILITY | Drop emitted population spikes; probability must be between zero and one. |
--intervention add:POPULATION=RATE_HZ | Add Poisson population spikes; repeatable interventions run in order. |
--inference-timestep-ms VALUE | Recompile a graph copy at a new timestep with generated Poisson inputs; incompatible with runtime continuation. |
Projection scaling and interventions apply to sim and use exact graph IDs. The source bundle is not rewritten. See inference options and runtime continuation for validation rules.
Legacy workflows
The legacy executor constructs predefined models from flags. A small synthetic-input simulation needs no bundle:
python -m snnlab.sim sim --executor legacy --model ping \
--n-in 4 --n-hidden 16 --n-inh 4 --n-batch 1 \
--input synthetic-spikes --input-rate 80 --t-ms 10 \
--seed 17 --out-dir runs/legacy-simLegacy dataset training, evaluation and weight export use the following workflow. MNIST training can download data, so the first run needs network access:
python -m snnlab.sim train --executor legacy --model ping --dataset mnist \
--n-hidden 16 --epochs 1 --max-samples 64 --batch-size 16 \
--lr 0.0001 --seed 17 --out-dir runs/legacy-train
python -m snnlab.sim sim --executor legacy --infer \
--load-config runs/legacy-train/config.json \
--load-weights runs/legacy-train/weights.pth \
--max-samples 64 --out-dir runs/legacy-inference
python -m snnlab.sim dump-weights --executor legacy \
--load-config runs/legacy-train/config.json \
--load-weights runs/legacy-train/weights.pth \
--out-dir runs/legacy-weightsExplicit CLI flags override values from --load-config. Legacy runs save config.json, run.sh, output.log and mode-specific artifacts: the synthetic probe above saves metrics.json, snapshot simulations save recording.npz, training saves weights and metrics, test-set inference saves metrics.json, and weight export saves weights_dump.npz. These differ from the graph artifact format. Choose separate output directories to keep runs distinct; legacy --wipe-dir deletes an existing output directory before running.
Complete argument reference
The tables below cover every argument accepted by the three subcommand parsers, including negative boolean forms. Commands lists where a flag is accepted; the behaviour column notes narrower execution paths. Defaults are parser defaults before loading a bundle or saved configuration. Boolean defaults describe the underlying setting, including on rows for negative forms. Unset means no explicit override; model or dataset defaults may then apply. Flags with multiple values take space-separated values.
Graph-only flags are listed separately at the end so their presence in legacy command help does not imply legacy support.
Network and timing
| Flag | Commands | Default | Behaviour / accepted values |
|---|---|---|---|
--bundle | sim, dump-weights, train | Unset | Load a compiled bundle through the legacy compatibility adapter, which supports a restricted PING topology/readout. Legacy train additionally requires an authenticated training recipe. |
--model | sim, dump-weights, train | ping | Model to simulate (default: ping) Choices: ping. |
--n-hidden | sim, dump-weights, train | Unset | One or more hidden sizes, e.g. 128 256 for stacked layers. Unset uses dataset-aware sizes (MNIST: 1024). Takes one or more values. |
--dales-law | sim, dump-weights, train | true | Enforce Dale’s law: clamp weights to non-negative (default: True) |
--no-dales-law | sim, dump-weights, train | true | Allow signed (positive + negative) weights. |
--ei-strength | sim, dump-weights, train | 0.5 | E-I coupling: sets W_EI=s, W_IE=s*ratio (default: 0.5) |
--ei-ratio | sim, dump-weights, train | 2.0 | W_IE/W_EI ratio (default: 2.0) |
--lyapunov-eps | sim, dump-weights, train | 0.0 | For a synthetic snapshot, repeat the forward pass with initial membrane voltages perturbed by this amount and save the voltage-divergence curve. Zero disables it; exponential growth can be used to estimate sensitivity. |
--dt | sim, dump-weights, train | 0.25 | Integration timestep in ms (default: 0.25) |
--refractory-e-ms | sim, dump-weights, train | 3.0 | Excitatory absolute refractory duration in ms (default: 3). |
--refractory-i-ms | sim, dump-weights, train | 1.5 | Inhibitory absolute refractory duration in ms (default: 1.5). |
--refractory-policy | sim, dump-weights, train | nearest | Counter conversion: nearest integer step, or require exact representation (default: nearest). Choices: nearest, exact. |
--t-ms | sim, dump-weights, train | 200.0 | Total simulation duration in ms (default: 200). Metrics are measured over the full trace; notebooks strip any startup transient in post. |
Readout
| Flag | Commands | Default | Behaviour / accepted values |
|---|---|---|---|
--readout | sim, dump-weights, train | rate | Output layer: ‘rate’ sums last-hidden spikes and projects linearly at the final timestep (default); ‘mem-mean’ averages a per-class output-LIF membrane over time; ‘spike-count’ sums each output-LIF neuron’s spikes over the presentation; ‘spike-rate’ divides those counts by presentation duration in seconds; ‘cumulative-potential’ sums the per-step softmax of a non-spiking leaky decoder membrane. Choices: rate, mem-mean, spike-count, spike-rate, cumulative-potential. |
--signed-readout | sim, dump-weights, train | false | Allow signed weights only in the abstract final classifier; the simulated input, feed-forward, and recurrent synapses remain Dale-constrained. |
--no-signed-readout | sim, dump-weights, train | false | Keep the final classifier weights non-negative (default). |
--readout-bias | sim, dump-weights, train | false | Enable a trainable signed bias in the final classifier. |
--no-readout-bias | sim, dump-weights, train | false | Disable the final classifier bias (default). |
--readout-w-out-scale | sim, dump-weights, train | 1.0 | Deprecated train-only scaling of the final readout weights and bias after construction. Cannot be combined with readout initialization mean/std. |
--readout-w-init-mean | sim, dump-weights, train | Unset | Parent mean of the lower-clamped Gaussian used to initialize stored W_ff[-1] directly. Zero-valued draws remain trainable. Must be used with —readout-w-init-std. Train-mode only. |
--readout-w-init-std | sim, dump-weights, train | Unset | Parent standard deviation of the lower-clamped Gaussian used to initialize stored W_ff[-1] directly. Must be used with —readout-w-init-mean. Train-mode only. |
Neuron dynamics
| Flag | Commands | Default | Behaviour / accepted values |
|---|---|---|---|
--tau-gaba | sim, train | Unset | Override inhibitory synaptic decay in milliseconds for sim or train. Unset uses loaded configuration or the model default (9 ms). |
--state-clamp | sim, dump-weights, train | false | Floor conductances at zero and cap their magnitude each timestep while retaining signed weights. |
--train-leak | sim, dump-weights, train | false | Make each hidden COBA cell’s leak membrane time constant trainable under bounded positive τ_m ranges. Adjusts leak conductance through the membrane time constant without changing AMPA/GABA synaptic decay. Default off. |
--no-train-leak | sim, dump-weights, train | false | Disable trainable leak conductance / τ_m heterogeneity (default). |
--tau-m-e-bounds-ms | sim, dump-weights, train | Unset | Bounds for trainable excitatory membrane τ_m in ms when —train-leak is enabled. Unset uses 5–50 ms. Takes 2 values. |
--tau-m-i-bounds-ms | sim, dump-weights, train | Unset | Bounds for trainable inhibitory membrane τ_m in ms when —train-leak is enabled. Unset uses 2–20 ms. Takes 2 values. |
--adaptive-threshold | sim, dump-weights, train | false | Enable trainable E-cell adaptive thresholds: recent spikes raise the effective threshold and decay with a bounded τ_adapt. Default off. |
--no-adaptive-threshold | sim, dump-weights, train | false | Disable adaptive thresholds (default). |
--adapt-tau-bounds-ms | sim, dump-weights, train | Unset | Bounds for trainable E-cell adaptive-threshold τ in ms. Unset uses 50–500 ms. Takes 2 values. |
--adapt-strength-init-mv | sim, dump-weights, train | 1.0 | Initial per-spike adaptive-threshold increment in mV. The value is trainable and bounded by —adapt-strength-max-mv. Default: 1.0. |
--adapt-strength-max-mv | sim, dump-weights, train | Unset | Upper bound for trainable adaptive-threshold strength in mV. Unset uses 20 mV. |
Input and drive
Synthetic-drive controls apply to synthetic simulation paths. Dataset selectors choose simulation samples; legacy training loads its dataset independently of --input. See the command column for parser availability.
| Flag | Commands | Default | Behaviour / accepted values |
|---|---|---|---|
--n-in | sim | 784 | Number of input channels (default: 784). |
--n-inh | sim | Unset | Inhibitory pool size (n_inh_per_layer, layer 1). |
--n-batch | sim | 64 | Number of Poisson-input trials averaged (default: 64). |
--input-file | sim, train | Unset | For legacy sim, replay dense input spikes from NPY or NPZ (input_spikes key). Accepted by train, but legacy training does not consume it. |
--w-ei-mean | sim | Unset | Explicit W_ei mean (overrides ei-strength/ratio). std = 0.1·mean. |
--w-ie-mean | sim | Unset | Explicit W_ie mean (independent of —w-ei-mean). |
--private-w-in | sim | false | Identity W_in: one input channel per E cell. |
--independent-drive | sim, dump-weights, train | Unset | Synthetic input: per-E-cell independent Poisson drive, taking RATE_HZ and G_PER_SPIKE in µS; bypasses input weights. Takes 2 values. |
--independent-drive-i | sim, dump-weights, train | Unset | Per-I-cell independent Poisson excitation; takes RATE_HZ and G_PER_SPIKE in µS. Takes 2 values. |
--quenched-drive | sim, dump-weights, train | Unset | Synthetic input: draw one constant excitatory conductance per E cell from a Gaussian with MEAN and STD in µS, clamp at zero and retain throughout the trial. Takes 2 values. |
--quenched-drive-i | sim, dump-weights, train | Unset | Same frozen Gaussian excitatory conductance as —quenched-drive, applied to I cells. Takes 2 values. |
--input | sim, dump-weights, train | synthetic-spikes | Input mode (default: synthetic-spikes) Choices: synthetic-spikes, dataset. |
--input-rate | sim, dump-weights, train | 25.0 | Baseline input rate in Hz (default: 25) |
--input-rates | sim, dump-weights, train | Unset | Training-only categorical maximum-pixel rates in Hz. One rate is sampled uniformly and independently per image presentation. Takes one or more values. |
--digit | sim, dump-weights, train | 0 | Digit class for dataset input (0-9) |
--sample | sim, dump-weights, train | 0 | Sample index for dataset input |
--sample-index | sim, dump-weights, train | Unset | Raw test-set index for a snapshot, overriding —digit/—sample selection (grabs ‘test trial N’ regardless of class). |
--dataset | sim, dump-weights, train | mnist | Dataset: mnist (static images) or shd (Spiking Heidelberg Digits, event-based audio; 700 channels, 20 classes). Default: mnist. Choices: mnist, shd. |
Weight initialization and learning
| Flag | Commands | Default | Behaviour / accepted values |
|---|---|---|---|
--w-in-initial-zero-fraction | sim, dump-weights, train | Unset | Fraction of input weights zeroed at initialization; surviving entries are rescaled and zeroed trainable entries may regrow. Unset uses 0.95 in the snapshot configuration, but 0 in train, inference and probe adapters. |
--recurrent-initial-zero-fraction | sim, dump-weights, train | 0.0 | Fraction of recurrent W_EE/W_EI/W_IE/W_II parameters set to zero only at initialization. Trainable entries may regrow. Survivors are divided by the surviving fraction. Default: 0. |
--exact-k-initialization | sim, dump-weights, train | false | Choose an exact number of initially nonzero recurrent entries per postsynaptic cell: round the presynaptic population size multiplied by the surviving fraction. This does not impose a persistent mask. No effect unless the recurrent initial-zero fraction is greater than zero. |
--surrogate-slope | sim, dump-weights, train | Unset | Fast-sigmoid surrogate-gradient slope; larger values narrow its active window around threshold. Unset retains the model setting (currently 5). |
--w-in | sim, dump-weights, train | Unset | Supply parent Gaussian mean/std on the fan-in-normalized summed-coupling scale. Two values set E input weights; four values additionally set I input mean/std. These are not per-edge moments. Takes one or more values. |
--w-ei | sim, dump-weights, train | Unset | W_EI parent Gaussian parameters on the summed-coupling scale. Takes 2 values. |
--w-ie | sim, dump-weights, train | Unset | W_IE parent Gaussian parameters on the summed-coupling scale. Takes 2 values. |
--w-ii | sim, dump-weights, train | Unset | W_II parent Gaussian parameters on the summed-coupling scale. Default: 0 0 (no I→I, canonical PING). Enable for Brunel/Vreeswijk balanced-network experiments. Takes 2 values. |
--w-ee | sim, dump-weights, train | Unset | W_EE parent Gaussian parameters on the summed-coupling scale. Default: 0 0 (no E→E, canonical PING). Enable for the full four-coupling Brunel/Vreeswijk balanced network (including recurrent excitation). Takes 2 values. |
--trainable-w-ee | sim, dump-weights, train | false | Make E→E recurrent weights trainable; otherwise frozen. |
--trainable-w-ei | sim, dump-weights, train | false | Make E→I recurrent weights trainable; otherwise frozen. |
--trainable-w-ie | sim, dump-weights, train | false | Make I→E recurrent weights trainable; otherwise frozen. |
--trainable-w-ii | sim, dump-weights, train | false | Make I→I recurrent weights trainable; otherwise frozen. |
Simulation and inference
Skip-load, perturbation, inhibitory replay and weight-scaling flags configure loaded-weight inference. Recording mode selects snapshot channels; recording-start-step trims retained probe rasters without shortening the simulation. Transition flags require a compatible legacy bundle simulation.
| Flag | Commands | Default | Behaviour / accepted values |
|---|---|---|---|
--infer | sim | false | Load trained weights and evaluate the legacy test set; saves metrics.json. Explicit digit/sample selectors request a snapshot instead. |
--load-config | sim, dump-weights | Unset | Load config from a JSON file (e.g., from a training run). CLI flags override loaded values. |
--load-weights | sim, dump-weights, train | Unset | Load a legacy PyTorch state dictionary for sim or dump-weights. Accepted by train, but legacy training does not consume it; graph training uses it for resume. |
--outputs | sim | Unset | Extra artifacts to emit from the one test-set forward pass (metrics.json is always written): per_cell_rates (per-cell E/I Hz → per_cell_rates.npz), pop_traces (per-trial population activity → pop_traces.npz, base signal for PSD/f_gamma), rasters (sparse per-trial spike indices → rasters.npz, for cycle-level analysis), spike_summary (—input-file only; compact per-presentation E/I/output spike counts). Choices: per_cell_rates, pop_traces, rasters, spike_summary. Takes one or more values. |
--recording-start-step | sim | 0 | First retained timestep; simulation and metrics still use the full window. |
--recording-mode | sim | full | Recording channels: full traces (default), E/I spikes only, or inhibitory spikes only. Metrics-only inference never records trajectories. Choices: full, spikes, inhibitory. |
--skip-load | sim | Unset | Drop state_dict keys with these prefixes before loading (e.g. W_ei. W_ie.) so a fresh sub-block survives — transfer-load probes. Takes one or more values. |
--perturb-mode | sim | Unset | Hidden-spike perturbation applied inside the forward loop: drop (Bernoulli mask), add (Poisson noise Hz). Choices: drop, add. |
--perturb-level | sim | Unset | Perturbation magnitude: one probability for drop, or one rate in Hz for add. The parser accepts a list, but the legacy perturbation requires a single value. |
--i-override-file | sim | Unset | NPZ with a sparse per-trial I-spike stream (i_trial/i_t/i_cell + n_trials/T/n_i) to substitute for the inhibitory spikes each timestep — generic injection dual of —outputs rasters. |
--scale-w-in | sim | 1.0 | Multiply loaded input weights (W_ff[0]) before the forward pass. |
--scale-w-ei | sim | 1.0 | Multiply loaded W_ei matrices before the forward pass. |
--scale-w-ie | sim | 1.0 | Multiply loaded W_ie matrices before the forward pass. |
--transition-bundle | sim | Unset | Smoothly scale recurrent matrices from —bundle to the compatible SNNLang endpoint bundle while preserving dynamic state. |
--transition-start-ms | sim | Unset | Start time for —transition-bundle’s smooth ramp. |
--transition-end-ms | sim | Unset | End time for —transition-bundle’s smooth ramp. |
Training
| Flag | Commands | Default | Behaviour / accepted values |
|---|---|---|---|
--max-samples | sim, train | Unset | Limit training or test-set evaluation to N samples; unset uses the full dataset. |
--lr | train | 0.01 | Learning rate for the legacy optimizer. Default 0.01; the PING training example above uses 0.0001. |
--weight-decay | train | 0.0 | AdamW decoupled weight decay; zero disables it. Applies during legacy training. |
--epochs | train | 0 | Number of training epochs. 0 = probe only (init snapshot, no training). Default: 0. |
--batch-size | train | Unset | Mini-batch size for DataLoader. Default: 64 (from models.BATCH_SIZE). |
--v-grad-dampen | train | 80.0 | Gradient dampening for COBA membrane |
--fr-reg-upper-target-hz | train | 0.0 | Hidden-E activity regulariser: population-mean firing-rate ceiling for each presentation, in Hz. The one-sided squared penalty is averaged over samples and hidden layers. Default: 0 Hz (only active when strength > 0). |
--fr-reg-upper-strength | train | 0.0 | Strength of the hidden-E firing-rate ceiling penalty; zero disables it. |
Output and execution
| Flag | Commands | Default | Behaviour / accepted values |
|---|---|---|---|
-h / --help | sim, dump-weights, train | — | show this help message and exit |
--output-fields | sim, dump-weights | Unset | Retain only these NPZ data fields, with lossless compression; shape metadata is automatic. Takes one or more values. |
--executor | sim, dump-weights, train | legacy | Execution backend (default: legacy). Graph execution is opt-in. Choices: legacy, graph. |
--out-dir | sim, dump-weights, train | Unset | Required output directory for every execution command. |
--wipe-dir | sim, dump-weights, train | false | Clear output directory before run |
--seed | sim, dump-weights, train | Unset | RNG seed. Seeds Python, NumPy, and torch (CPU + CUDA + MPS) before dataset load and model init. Persisted to config.json. |
Graph-only arguments accepted by the parser
These flags configure graph execution and have no supported legacy effect. Runtime-state, event, dataset-file, Poisson-protocol, projection-scale, intervention and timestep flags are explicitly rejected when supplied to the legacy executor; other graph fields may be parsed but ignored. Use --executor graph and the contracts above.
| Flag | Commands | Default | Behaviour / accepted values |
|---|---|---|---|
--scale-projection | sim | No entries | Multiply a named graph projection for this inference request; repeatable. |
--intervention | sim | No entries | Ordered spike intervention: drop:POPULATION=PROBABILITY or add:POPULATION=RATE_HZ; repeatable. |
--inference-timestep-ms | sim | Unset | Recompile an immutable graph copy at this inference timestep. |
--event-file | sim | Unset | Sparse event-stream NPZ replay for graph execution. Coordinates are zero-based integer steps, batches, and channels. |
--dataset-file | sim, train | Unset | Immutable NPZ dataset snapshot for graph execution. |
--dataset-encoder | sim, train | Unset | Standard encoder applied to —dataset-file. Choices: rate-poisson, prebinned-spikes, event-bin. |
--dataset-input-id | sim, train | Unset | Declared graph input ID receiving snapshot features. |
--dataset-target-id | sim, train | Unset | Recipe target ID receiving snapshot labels; required for graph dataset training. |
--dataset-feature-key | sim, train | features | Feature array key in a graph dataset snapshot. |
--dataset-label-key | sim, train | labels | Label array key in a graph dataset snapshot. |
--poisson-protocol | sim | Unset | Generate graph-input Poisson spikes from —input-rate or —input-rates. Choices: fixed-rate, categorical-rate. |
--input-dataset-id | sim, train | Unset | Stable dataset or snapshot identity recorded for a graph replay. |
--input-split | sim, train | Unset | Dataset split recorded for a graph replay. |
--input-shuffle / --no-input-shuffle | sim, train | Unset | Record replay shuffle provenance for graph sim; deterministically shuffle graph-training samples each epoch. The negative form disables it. |
--device | sim, dump-weights, train | auto | Graph execution device: auto, cpu, cuda, cuda:N, or mps (default: auto). |
--diagnostics / --no-diagnostics | sim, dump-weights, train | true | Return exposed graph diagnostics (default: enabled; use —no-diagnostics to disable). |
--load-runtime-state | sim, dump-weights, train | Unset | Restore complete graph-executor dynamic state from a runtime-state directory. |
--save-runtime-state | sim, dump-weights, train | Unset | Save complete graph-executor dynamic state to a runtime-state directory. |
--target-file | train | Unset | Integer NPY/NPZ graph-training targets, bound by recipe target id. |
--save-final-checkpoint | train | Unset | Write the final graph-training checkpoint directory. |
--save-selected-checkpoint | train | Unset | Write the lowest-loss graph-training checkpoint directory. |