snnlab.sim.scan
Complete declared API of the scan module, with signatures, data fields, validation and source.
Scan-mode utilities.
Provides shared utilities for scanning parameters and recording-key resolution.
The signatures, defaults, fields, docstrings and implementation excerpts below are generated from the Python source. Annotations are shown as declared; unannotated means the source supplies no type annotation. These pages document callable surfaces, including legacy support utilities, without promising backend support for every declaration.
| Symbol | Kind |
|---|---|
| primary_hid_key | function |
| primary_inh_key | function |
primary_hid_key
def primary_hid_key(rec)Source docstring:
Return the recording key for the deepest hidden layer.
WHY: Multi-layer networks record each layer separately ('hid_0', 'hid_1', etc.).
For analysis, we typically care about the DEEPEST/FINAL hidden layer
(the one with the most relevant representation before readout).
Returns:
str: Recording key for the deepest excitatory layer.
Single-layer models: 'hid'
Multi-layer models: 'hid_1' (layer 1 is the deepest; layer 0 is input→hid_0)
Networks with no hidden layer: 'hid' (default fallback)
Args:
rec: Recording dict from network.spike_record| Parameter | Annotation | Default | Meaning |
|---|---|---|---|
rec | unannotated | required | Defined by the source contract and implementation below. |
Return expressions (branch-dependent; names refer to the linked implementation):
hid_keys[-1] if hid_keys else 'hid'Implementation
def primary_hid_key(rec):
"""Return the recording key for the deepest hidden layer.
WHY: Multi-layer networks record each layer separately ('hid_0', 'hid_1', etc.).
For analysis, we typically care about the DEEPEST/FINAL hidden layer
(the one with the most relevant representation before readout).
Returns:
str: Recording key for the deepest excitatory layer.
Single-layer models: 'hid'
Multi-layer models: 'hid_1' (layer 1 is the deepest; layer 0 is input→hid_0)
Networks with no hidden layer: 'hid' (default fallback)
Args:
rec: Recording dict from network.spike_record
"""
hid_keys = sorted(k for k in rec if k.startswith("hid"))
return hid_keys[-1] if hid_keys else "hid"primary_inh_key
def primary_inh_key(rec)Source docstring:
Return the recording key for the deepest inhibitory layer, or None if no inhibition.
WHY: Like primary_hid_key, but for inhibitory spikes. Networks without E-I
structure return None (e.g., standard feedforward networks).
Returns:
str or None: Recording key for the deepest inhibitory layer (e.g. 'inh', 'inh_1'),
or None if the network doesn't have inhibitory populations.
Args:
rec: Recording dict from network.spike_record| Parameter | Annotation | Default | Meaning |
|---|---|---|---|
rec | unannotated | required | Defined by the source contract and implementation below. |
Return expressions (branch-dependent; names refer to the linked implementation):
inh_keys[-1] if inh_keys else NoneImplementation
def primary_inh_key(rec):
"""Return the recording key for the deepest inhibitory layer, or None if no inhibition.
WHY: Like primary_hid_key, but for inhibitory spikes. Networks without E-I
structure return None (e.g., standard feedforward networks).
Returns:
str or None: Recording key for the deepest inhibitory layer (e.g. 'inh', 'inh_1'),
or None if the network doesn't have inhibitory populations.
Args:
rec: Recording dict from network.spike_record
"""
inh_keys = sorted(k for k in rec if k.startswith("inh"))
return inh_keys[-1] if inh_keys else NoneConstants and type aliases
Initial source expressions are shown, not evaluated runtime values. Legacy configuration may mutate module defaults.
| Name | Annotation | Initial expression | Source |
|---|---|---|---|
log | unannotated | logging.getLogger('cli') | Source |