Structured E/I cores
A structured E/I core is a stack of layers, each with one excitatory and one
optional inhibitory population of dendritic neurons, built from the typed
sections of model.core: architecture, connectivity, transfer,
morphology, sparsity, reactivation, blocklinear and
implementation. One set of options applies to every population, and the
core type selects how excitation and inhibition combine. Use a structured core
for E/I stacks of this shape; use a population network for named populations, per-population options or
explicit connections. This page also covers the unified E/I core
(unified_ei), which takes one option block per population, the spatial
cores built from the same sections, and a reference of every section field.
Two names recur on this page:
structured E/I core: the
einet,dendritic_*andflat_*core types. The feedforward network isConfigurableEINetwork(a subclass ofExcitationInhibitionNetwork); the recurrent network isEINetwork.unified E/I core: the
ei_unifiedtype (also spelledunified_ei) and thernn_*aliases, configured undermodel.core.unified_eiand built asEINetwork.
Core types and integration mode
The structured core types differ in how a compartment combines its
excitatory and inhibitory input (see Integration modes for the
equations), in the sign of their synaptic weights and in the shape of the
dendritic tree. Core types lists every model.core.type.
|
Integration |
Synaptic weights |
Recurrent form |
|---|---|---|---|
|
set by |
positive ( |
yes |
|
shunting (divisive) |
positive |
yes |
|
raw additive |
positive |
yes |
|
additive, normalized across the layer’s outputs |
positive |
yes |
|
as the |
positive |
no |
|
additive |
signed ( |
no |
|
additive |
signed ( |
no |
A flat_* type flattens the excitatory tree into one dendritic level that
holds all of its compartments: excitatory_branch_factors: [3, 3] (3 + 9
compartments) becomes [12]. The inhibitory tree is not changed.
Which setting decides
Each family has one source of truth for the integration mode:
dendritic_*andflat_*types (except*_signed) fixmorphology.use_shunting; the additive types also fixmorphology.use_additive_normalization. A written value that contradicts the type raises when the config loads. A savedconfig.json, which lists every field, loads with a warning and the type’s value.*_signedand*_mlptypes always buildidentityweights with additive integration: they fixmorphology.weight_transform: identityandmorphology.use_shunting: false, and a written value that contradicts them raises when the config loads (a savedconfig.jsonloads with a warning and the type’s values).einet, the spatial types anddendritic_alexnetreadmorphology.use_shuntingandmorphology.use_additive_normalization.The
rnn_*aliases of the unified E/I core setuse_shuntinganduse_additive_normalizationin every population block, and thernn_flat_*aliases also setbranch_factors: [1]. A block value that contradicts the alias is replaced, with a warning.ei_unifiedandpopulation_networkread the fields of each population block.
When reactivation.init_policy is omitted, the additive structured types and
einet with use_shunting: false initialize their gates with
occupancy_quantile; every other core uses analytical
(Gate initialization and maintenance).
ExcitationInhibitionNetwork
The feedforward structured core first passes its input through a
TransferLayer, which produces an excitatory and an inhibitory input
stream. Each layer then runs its inhibitory population before its excitatory
population:
(x_E, x_I) = TransferLayer(x)
h_I[l] = inhibitory_cells[l](h_E[l-1], h_I[l-1]) # h_E[0] = x_E, h_I[0] = x_I
h_E[l] = excitatory_cells[l](h_E[l-1], h_I[l])
output = h_E[last]
A layer without inhibitory cells passes its inhibitory input on unchanged
(Inhibitory wiring says which cells may read it). The output size is
the last entry of architecture.excitatory_layer_sizes. The
excitatory cells are a DendriNet with excitatory_branch_factors
(The dendritic tree). The inhibitory cells are a DendriNet with
inhibitory_branch_factors or, with architecture.inhibitory_network_type:
mlp, a dense MLP with sigmoid outputs that reads the layer’s excitatory
input (mlp_inhibitory_network_params; feedforward cores only).
A shunting network with a nonnegative weight transform (exp, softplus
or relu) checks the transferred input on every forward pass and raises
when it is negative, because negative conductance drive can make the shunting
denominator vanish. Keep the input
nonnegative (for example data.processing.normalize: false for images),
set transfer.output_activation: relu, or use an additive type.
TransferLayer
TransferLayer turns the core input into the excitatory and the inhibitory
input stream. With independent_pathways: false both streams carry the
whole input. With true the input channels are split between the streams,
so each channel is either excitatory or inhibitory. Its options are in
model.core.transfer:
Field |
Type |
Default |
Meaning |
|---|---|---|---|
|
bool |
|
Split the input channels between the streams instead of copying the input into both. |
|
int or null |
|
Stream sizes of the split. An unset size is the rest of the input; with
both unset the input is halved. Setting them without
|
|
str |
|
|
|
str |
|
|
|
int or null |
|
Seed of the |
|
str or null |
|
Applied to both streams: |
|
str or null |
|
Only |
TransferLayer also accepts input_normalization (a mapping with
mode: none, global_l1 or group_l1; group_ranges for
group_l1; epsilon), which divides the input by the L1 norm of all
channels or of each declared channel range. model.core.transfer does not
have this field; it is set through model.core.unified_ei.transfer_params
or model.core.population_network.transfer_params.
Inhibitory wiring
Feedforward and recurrent structured cores wire their inhibitory synapses by
one rule, determined by architecture.inhibitory_layer_sizes and the
synapse counts in model.core.connectivity:
The first layer’s feedforward inhibitory input is the transfer layer’s inhibitory stream; a later layer’s is the previous layer’s inhibitory cells.
Inhibitory cells read the layer’s excitatory input on their
eisynapses and its feedforward inhibitory input on theiriisynapses.Excitatory cells read their own layer’s inhibitory cells on their
iesynapses. When the first layer has no inhibitory cells, its excitatory cells read the transferred inhibitory stream directly.
inhibitory_layer_sizes is either empty (no layer has inhibitory cells) or
gives one size per layer, 0 for a layer without inhibitory cells. Synapse
lists give one count per layer and
repeat their last entry for later layers. A synapse count without a source
raises: ie synapses in a later layer that has no inhibitory cells, ii
synapses in a layer that receives no inhibitory input, and inhibitory synapse
counts for cells a layer does not have. Inhibitory cells without any input
synapse (ei, ii, rec_ei and rec_ii all 0) raise as well.
The input therefore reaches inhibition in one of two ways:
through inhibitory cells: declare them (
inhibitory_layer_sizes: [20]witheisynapses); the input drives them and they inhibit the excitatory cells;directly: declare none (
inhibitory_layer_sizes: []); the input’s inhibitory stream drives the first layer’siesynapses. In a network of several layers, writeie_synapses_per_branch_per_layer: [8, 0], because later layers have no inhibitory source.
A population network expresses the same wirings
with connections from input_e and input_i
(Connections). The retired model.core.transfer keys
input_mode, inhibitory_mode, allow_direct_inhibitory_stream,
allow_direct_inhibitory_input, require_explicit_direct_inhibitory_stream,
input_mode1_build_inhibitory_population and
build_inhibitory_population_for_input_mode1 load with a warning when they
describe the wiring above and raise when they selected a different network
(for example input_mode: 1 with declared inhibitory cells).
input_mode: 1 was the default of feedforward cores: a feedforward config
written for an earlier version that declares inhibitory cells without setting
input_mode ran without them, while the current library builds them.
dendritic-upgrade-config (Upgrading configs written for earlier versions) rewrites such configs so
that they describe the network they ran.
Feedforward example
A two-layer shunting core with an inhibitory population in each layer, for a
flattened 28 x 28 input. dendritic-train sets
model.encoder.params.input_dim from the dataset (the number of elements of
one sample); the examples on this page write it so that they also build
without a dataset.
model:
encoder:
type: identity
params: {input_dim: 784}
core:
type: dendritic_shunting
transfer:
output_activation: nonnegative
architecture:
excitatory_layer_sizes: [100, 50]
inhibitory_layer_sizes: [20, 10]
excitatory_branch_factors: [3, 3]
inhibitory_branch_factors: [1]
connectivity:
ee_synapses_per_branch_per_layer: [40] # input or previous E onto E
ei_synapses_per_branch_per_layer: [10] # input or previous E onto I
ie_synapses_per_branch_per_layer: [10] # this layer's I onto E
ii_synapses_per_branch_per_layer: [0]
morphology:
weight_transform: softplus
dbl_init_method: analytical_expectation
sparsity:
type: indexed_rewire
indexed:
rewire_frequency: 100
rewire_quantile: 0.05
reactivation:
type: param_tanh
decoder:
type: MLP
params: {hidden_dims: [], output_dim: 10}
Recurrent structured cores
The structured types einet, dendritic_shunting, dendritic_additive
and dendritic_normalized_additive build the recurrent EINetwork
instead of the feedforward network when any of these is set:
a positive
connectivity.rec_*synapse count in any layer;a stateful feature:
model.core.dynamics.mode: spike(Spiking soma),model.core.dendritic_spikes.enabled(Dendritic spikes and plateaus),model.core.soma_feedback.enabled(Soma-to-dendrite feedback) ormodel.core.synapse_types.enabled(Receptor synapse types);model.core.recurrent_ei.enabled: true. A layer becomes recurrent only through one of the above or a truerecurrent_ei.recurrent_layersentry; when no layer does, the build raises.
The flat_*, *_signed and *_mlp types are feedforward only and raise
when one of these is set. A recurrent core raises for the feedforward-only
options reactivation.soma_type (and non-default soma_init_m or
soma_init_b), architecture.inhibitory_network_type: mlp and
implementation.compile_forward: true. A feedforward core raises for the
recurrent-only options architecture.input_projection_dims,
implementation.store_routing: true, morphology.allow_self_recurrence:
false and any recurrent_ei setting other than enabled: false.
The recurrent network reuses every structured section: each layer gets one
excitatory and one inhibitory population (the latter when
inhibitory_layer_sizes declares cells) with the options of
morphology, sparsity, reactivation, blocklinear and
implementation. It runs the transfer layer, the optional
input_projection_dims (dense ReLU layers applied to the excitatory
stream) and the layers once per timestep, and trains with
training.main.strategy: recurrent (Training strategies).
Recurrent synapses
The recurrent synapse counts are per-layer lists in
model.core.connectivity (one value per layer, last value repeated, default
[0]). Within a timestep the inhibitory population updates first; the
excitatory population then reads this step’s inhibitory output on its ie
synapses. Recurrent synapses read the previous timestep’s outputs of the same
layer:
Field |
Target population |
Source (previous timestep) |
|---|---|---|
|
excitatory |
the layer’s excitatory output |
|
excitatory |
the layer’s inhibitory output |
|
inhibitory |
the layer’s excitatory output |
|
inhibitory |
the layer’s inhibitory output |
morphology.allow_self_recurrence: false removes each neuron’s synapse onto
itself from the rec_ee and rec_ii banks and keeps all other recurrent
contacts.
Temporal settings (recurrent_ei)
model.core.recurrent_ei holds the temporal settings of a recurrent
structured core. Every dendritic level keeps leaky traces of its feedforward
excitatory, feedforward inhibitory, recurrent excitatory, recurrent inhibitory
and child-branch input:
and integrates the traces with the layer’s shunting or additive rule. Level
time constants are geometric unless level_taus is set:
\(\tau_i = \tau_\mathrm{base} \cdot \tau_\mathrm{ratio}^{\,n - 1 - i}\)
for level \(i\) of \(n\), counted from the most distal level, so
distal levels are slower (Temporal constants and delays).
Field |
Type |
Default |
Meaning |
|---|---|---|---|
|
bool |
|
Build the recurrent network although no |
|
bool or list of bool |
unset |
Which layers keep state (last entry repeats). Unset, a layer is
recurrent when it has recurrent synapses or a stateful feature. A
|
|
float or list |
|
Integration step, scalar or one value per layer. |
|
float or list |
|
Time constant of the soma level, scalar or per layer. |
|
float or list |
|
Ratio between the time constants of adjacent levels, scalar or per layer. |
|
list of float |
|
Explicit time constant of every level, distal to soma; replaces
|
|
bool |
|
Train the time constants (stored as log values). |
|
float |
|
Constant added to the shunting denominator. |
|
str |
|
|
|
bool |
|
Build the transfer layer. With |
Other keys under recurrent_ei raise. Transfer options are read only from
model.core.transfer; the spellings recurrent_ei.transfer,
recurrent_ei.transfer_params and recurrent_ei.recurrent_per_layer raise
with the replacement location.
Recurrent example
A one-layer recurrent shunting core with recurrent E and I synapses:
model:
encoder:
type: identity
params: {input_dim: 32}
core:
type: dendritic_shunting
architecture:
excitatory_layer_sizes: [64]
inhibitory_layer_sizes: [16]
excitatory_branch_factors: [3, 3]
inhibitory_branch_factors: [1]
connectivity:
ee_synapses_per_branch_per_layer: [12]
ei_synapses_per_branch_per_layer: [8]
ie_synapses_per_branch_per_layer: [6]
ii_synapses_per_branch_per_layer: [0]
rec_ee_synapses_per_branch: [8]
rec_ie_synapses_per_branch: [4]
rec_ei_synapses_per_branch: [8]
rec_ii_synapses_per_branch: [4]
transfer:
output_activation: relu
recurrent_ei:
output_mode: last
dt: 1.0
tau_base: 50.0
tau_ratio: 3.0
decoder:
type: MLP
params: {hidden_dims: [], output_dim: 10}
training:
main:
strategy: recurrent
The core expects sequences [B, T, 32]. For gated recurrent baselines use
model.core.type: gru, lstm or vanilla_rnn (Baselines and comparison models).
Unified E/I core
model.core.type: ei_unified (or unified_ei) builds an EINetwork
from model.core.unified_ei, which gives every layer its own excitatory and
inhibitory population block. Use it when the populations of a layer, or the
layers of a stack, need different options, such as different time constants,
synapse counts or morphologies. The section spelled model.core.ei_unified
loads with a deprecation warning, and so do the type names ei_net and
unified_einet. A unified_ei core reads only model.core.unified_ei;
other non-default model.core sections raise.
model.core.unified_ei holds the fields of EINetworkConfig:
Field |
Type |
Default |
Meaning |
|---|---|---|---|
|
list |
required |
One mapping per layer with the |
|
bool |
|
Pass the input through a |
|
mapping |
|
|
|
list of int |
|
Dense ReLU layers applied to the excitatory input stream before the first layer. |
|
str |
|
Recurrent networks: |
|
bool |
|
Record each layer’s per-level routing at every timestep for analysis (recurrent networks). |
|
int |
from the encoder |
Set from the encoder output size; a different written value raises. |
Each entry of layers holds the fields of EILayerConfig:
Field |
Type |
Default |
Meaning |
|---|---|---|---|
|
mapping |
required |
Population block of the excitatory population. |
|
mapping or null |
required |
Population block of the inhibitory population, or |
|
bool |
|
Keep state across timesteps and build recurrent synapses. A
non-recurrent layer raises when a population sets recurrent synapse
counts or a stateful feature (spiking soma, |
|
float |
|
Integration step of the layer. |
|
bool |
|
With |
excitatory_input_dim and inhibitory_input_dim are also
EILayerConfig fields, but the network sets them from the previous layer
when it builds, replacing written values.
The wiring within a layer is the one of the recurrent structured core: the
inhibitory population updates first and reads the excitatory input on its
ff_excitatory_synapses, the feedforward inhibitory input on its
ff_inhibitory_synapses, and the previous timestep’s E and I outputs on
its rec_excitatory_synapses and rec_inhibitory_synapses. The
excitatory population reads the excitatory input, this step’s inhibitory
output on its ff_inhibitory_synapses, and the previous E and I outputs on
its recurrent synapses.
Population blocks
excitatory and inhibitory are PopulationConfig mappings, the same
options a population network takes in population_defaults and
population blocks; Options reference lists every field. In
unified_ei the morphology is part of the block: n_neurons (default 64)
and branch_factors (default [1]) are written there. Unknown keys raise
when the model is built. allow_self_recurrence: false removes each
neuron’s synapse onto itself from its population’s recurrent bank.
Some defaults of a population block differ from the structured sections:
Option |
Structured section default |
Population block default |
|---|---|---|
weight transform |
|
|
somatic synapses |
|
|
initial gate slope |
|
|
Write these options explicitly to use the same parameterization in both forms.
Recurrent aliases
rnn_dendritic_shunting, rnn_dendritic_additive,
rnn_dendritic_normalized_additive, rnn_flat_shunting,
rnn_flat_additive and rnn_flat_normalized_additive read
model.core.unified_ei like ei_unified and set use_shunting and
use_additive_normalization in every population block; the rnn_flat_*
aliases also set branch_factors: [1]. They do not change the gate
initialization: set reactivation_init_policy in the blocks of an additive
alias (Gate initialization and maintenance).
Unified core example
A one-layer recurrent unified core:
model:
encoder:
type: identity
params: {input_dim: 32}
core:
type: ei_unified
unified_ei:
input_transform: nonnegative
output_mode: last
layers:
- recurrent: true
dt: 1.0
excitatory:
n_neurons: 64
branch_factors: [3, 3]
ff_excitatory_synapses: 12
ff_inhibitory_synapses: 6
rec_excitatory_synapses: 8
rec_inhibitory_synapses: 4
allow_self_recurrence: false
tau_base: 50.0
tau_ratio: 3.0
inhibitory:
n_neurons: 16
branch_factors: [3, 3]
ff_excitatory_synapses: 8
ff_inhibitory_synapses: 0
rec_excitatory_synapses: 4
rec_inhibitory_synapses: 2
allow_self_recurrence: false
decoder:
type: MLP
params: {hidden_dims: [], output_dim: 10}
training:
main:
strategy: recurrent
Without a transfer layer the first layer’s inhibitory population has no
feedforward inhibitory input, so the example gives it
ff_inhibitory_synapses: 0. A layer’s feedforward inhibitory input is the
transferred stream (first layer with use_transfer: true, or a layer with
direct_ff_inhibitory_to_excitatory: true) or the previous layer’s
inhibitory population; its excitatory population reads the layer’s own
inhibitory population, or that input directly when the layer has none and
sets direct_ff_inhibitory_to_excitatory. A written
ff_inhibitory_synapses or rec_inhibitory_synapses (or its
*_by_level list) above 0 without such a source raises when the model is
built. An omitted ff_inhibitory_synapses is the population default 4,
which builds no synapses where there is no source.
Embedded and spatial cores
These cores apply a structured E/I network to image-shaped input or place it
inside a larger network. They read the same structured sections as
einet, including morphology.use_shunting, and are feedforward only:
recurrent synapse counts, stateful features and recurrent_ei settings
raise.
Input and output adapters
A dendritic core inside another network follows the contract
input adapter -> dendritic core -> output adapter. The adapters are in
dendritic_modeling.networks.architectures.replacement:
Input adapters map signed activity into the nonnegative range of positive-conductance cores:
identity(the input is already nonnegative),relu(keeps the positive part) andsigned_split([relu(x), relu(-x)], which doubles the number of features or channels). They are selected bymodel.core.population_network.input_transform,model.core.spatial.input_transformandmodel.core.vision.input_transform.Output adapters rescale each channel without mixing channels:
identity(the default);learned_globalandlearned_per_channel(a learned positive gain);learned_global_threshold_reluandlearned_per_channel_threshold_relu(relu(gain * x - threshold)with learned positive gain and threshold);signed_per_channel_affine(a learned signed gain and offset per channel, starting at the identity). They are selected bymodel.core.spatial.output_adapter_modeandmodel.core.vision.output_adapter.mode.
Tensor-map cores
hierarchical_dendritic_tensor_map (aliases dendritic_tensor_map and
tensor_map) flattens an input of shape (B, C, H, W), or takes a flat
input (B, D), and runs the structured E/I network on it. Its encoder output
size is the flattened size, for example input_dim: 3072 for a
[3, 32, 32] image. The output is the last excitatory layer, so an MLP
decoder reads it as usual. Built directly with
get_architecture(..., suffix_input_dim=n), the core adds a linear
projection to n outputs when n differs from its excitatory output;
initialize_model passes no suffix_input_dim.
model:
encoder:
type: identity
params: {input_dim: 3072} # 3 x 32 x 32, flattened
core:
type: hierarchical_dendritic_tensor_map
architecture:
excitatory_layer_sizes: [64]
inhibitory_layer_sizes: [16]
excitatory_branch_factors: [3, 3]
inhibitory_branch_factors: [1]
connectivity:
ee_synapses_per_branch_per_layer: [40]
ei_synapses_per_branch_per_layer: [40]
ie_synapses_per_branch_per_layer: [8]
ii_synapses_per_branch_per_layer: [0]
morphology:
use_shunting: true
decoder:
type: MLP
params: {hidden_dims: [], output_dim: 10}
To restrict the feature-map pathways by image position, declare
connectivity.structured.pathways.ee and .ei with the method
spatial_morphology and leave ie undeclared, because the inhibitory
cells’ outputs have no spatial layout (Structured connectivity).
Convolutional cores
hierarchical_dendritic_conv (alias spatial_dendritic_conv) extracts
local patches of an input (B, C_in, H, W) and runs one shared structured
E/I network on every patch, giving a feature map (B, C_out, H_out, W_out)
with C_out the last entry of excitatory_layer_sizes. At each output
position, excitatory soma c is output channel c; the same soma/channel
mapping and the same parameters are used at every position. The inhibitory
population acts within each position and is not part of the output, so two
convolutional cores can be stacked with ordinary pooling or normalization
between them. spatial_output_contract() returns this mapping as a
dictionary.
The local geometry and the adapters are set in model.core.spatial:
Field |
Type |
Default |
Meaning |
|---|---|---|---|
|
int |
|
Patch size. |
|
int |
|
Patch stride. |
|
int |
|
Zero padding added before the patches are taken. |
|
str |
|
Input adapter: |
|
float |
|
Positive factor applied to the adapted input, to bring large activations into the range the conductance initialization assumes. |
|
str |
|
Output adapter (see above). |
|
float |
|
Initial gain of a learned output adapter. |
|
float |
|
Initial threshold of a threshold output adapter. |
Only the convolutional cores read model.core.spatial, and the sparse
point control below reads only kernel_size, stride and padding.
For every other built-in core type a spatial option that differs from its
default raises when the configuration loads, and so do the adapter options of
the sparse point control; a saved config.json loads with a warning
instead. Core types that plugins register are not checked.
As the model.core of a classifier, a convolutional core reads the images
themselves: use the identity encoder and load the dataset as images
(data.processing.flatten: false), so that dendritic-train sets
model.encoder.params.input_shape to [C, H, W]. The core receives C
channels, and its feature maps are flattened, channel first, for the decoder,
which therefore reads C_out * H_out * W_out values
(FlattenedSpatialCore in dendritic_modeling.networks.architectures.vision
wraps the core). Images of another size raise. A flattened dataset or another
encoder raises when the model is built. To use the core inside another
network, build it directly with the number of input channels as
input_dim:
import torch
from dendritic_modeling.config import config_from_mapping
from dendritic_modeling.networks.architectures.factory import get_architecture
core = config_from_mapping(
{
"model": {
"core": {
"type": "hierarchical_dendritic_conv",
"architecture": {
"excitatory_layer_sizes": [16],
"inhibitory_layer_sizes": [4],
"excitatory_branch_factors": [3],
"inhibitory_branch_factors": [1],
},
"connectivity": {
"ee_synapses_per_branch_per_layer": [9],
"ei_synapses_per_branch_per_layer": [9],
"ie_synapses_per_branch_per_layer": [2],
},
"spatial": {"kernel_size": 3, "padding": 1},
}
}
}
).model.core
conv = get_architecture(core.type, core, input_dim=3) # input_dim: input channels
features = conv(torch.rand(2, 3, 32, 32)) # shape (2, 16, 32, 32)
sparse_active_matched_point_conv (alias
spatial_sparse_active_matched_point) is a control for the convolutional
core: one fixed-support sparse affine layer with ReLU, applied to every patch
and taking kernel_size, stride and padding from
model.core.spatial (it has no input or output adapter, so the other
spatial options raise). Like the convolutional core, it returns a feature
map, takes the number of input channels as input_dim and is flattened
for the decoder of a classifier in the same way. Its number of
trained scalars equals the active parameter count of the E/I network that the
same sections describe, or
model.core.target_active_parameters when set; building raises when that
budget needs more inputs per output than a patch has. It requires
sparsity.indexed.seed, which training fills from the experiment’s
topology seed (Random seeds and reproducibility flags). Baselines and comparison models describes the
other matched controls.
Dendritic AlexNet
dendritic_alexnet builds a complete classifier with the AlexNet layout:
five convolutional cores, max pooling, adaptive average pooling and three
feedforward structured E/I blocks, the last of which has one excitatory soma
per class. Every block uses the structured sections for its dendritic options
and takes its population sizes from model.core.vision; writing
architecture.excitatory_layer_sizes or inhibitory_layer_sizes raises.
Set data.processing.flatten: false so that images keep their
(B, C, H, W) shape; the network takes the number of image channels from
them (an explicit vision.input_channels must match). Use the identity
decoder so the class somas are the logits;
with an identity decoder the classifier learns a positive scale per class
(Classifier output scale). The example below is a reduced network for 32 x 32
images.
|
Default |
Meaning |
|---|---|---|
|
|
Output channels of the five convolutional cores. |
|
|
Patch geometry of the five convolutional cores. |
|
|
Convolutional cores (0-4) followed by max pooling. |
|
|
Max-pooling window and stride. |
|
|
Output size of the adaptive average pooling before the classifier. |
|
|
Widths of the two hidden feedforward blocks. |
|
|
Somas of the final block (at least 2). |
|
|
Inhibitory cells per block as a fraction of its excitatory cells
(at least one; |
|
|
Dropout before each hidden feedforward block. |
|
|
Input adapter of the image ( |
|
the image channels |
Number of image channels. A classifier built from a configuration
takes it from |
|
|
Base seed of the blocks’ parameter initialization (block |
|
|
Output adapter after each convolutional core and hidden block:
|
|
|
Somas per output channel or unit: |
data:
dataset_name: cifar10
processing: {flatten: false}
model:
encoder:
type: identity
core:
type: dendritic_alexnet
architecture:
excitatory_branch_factors: [2]
inhibitory_branch_factors: [1]
connectivity:
ee_synapses_per_branch_per_layer: [8]
ei_synapses_per_branch_per_layer: [8]
ie_synapses_per_branch_per_layer: [2]
ii_synapses_per_branch_per_layer: [0]
transfer:
output_activation: relu
vision:
input_channels: 3
channels: [8, 16, 16, 16, 8]
kernels: [3, 3, 3, 3, 3]
strides: [1, 1, 1, 1, 1]
paddings: [1, 1, 1, 1, 1]
pool_kernel: 2
pool_stride: 2
adaptive_pool_shape: [2, 2]
classifier_widths: [32, 32]
num_classes: 10
output_adapter: {mode: learned_per_channel}
decoder:
type: identity
Configuration reference
The tables list every field of the structured sections with its type and
default. model.core.transfer is described in TransferLayer,
model.core.recurrent_ei in Recurrent structured cores and
model.core.spatial in Embedded and spatial cores. A population network sets the
same options per population (Options reference). The common fields
model.core.type, initialization_seed and biological_neuron apply
to every core (Random seeds and reproducibility flags, Biological constraints).
model.core.architecture
Field |
Type |
Default |
Meaning |
|---|---|---|---|
|
list of int |
|
Excitatory cells per layer; the last entry is the core output size. |
|
list of int |
|
Inhibitory cells per layer: empty, or one positive size per layer (Inhibitory wiring). |
|
list of int |
|
Dendritic tree of the excitatory cells, shared by all layers (The dendritic tree). |
|
list of int |
|
Dendritic tree of the inhibitory cells. |
|
list of int |
|
Recurrent cores only: dense ReLU layers applied to the excitatory input before the first layer. |
|
str |
|
|
|
mapping |
|
Hidden layers and activation of |
model.core.connectivity
Counts are synapses per dendritic branch, one value per layer, with the last value repeated for later layers. Write at most one value per layer: longer lists raise when the config loads, for every core type built from these sections (the structured E/I types, the spatial cores and the controls matched to a structured E/I network).
Field |
Type |
Default |
Meaning |
|---|---|---|---|
|
list of int |
|
Excitatory input (transferred stream or previous layer) onto excitatory cells. |
|
list of int |
|
Excitatory input onto inhibitory cells. |
|
list of int |
|
Inhibitory input (own layer’s inhibitory cells, or the transferred stream) onto excitatory cells. |
|
list of int |
|
Feedforward inhibitory input onto inhibitory cells. |
|
list of int |
|
Recurrent synapses (Recurrent structured cores). |
|
mapping |
disabled |
Fixed topology masks per pathway (Structured connectivity). |
model.core.morphology
Field |
Type |
Default |
Meaning |
|---|---|---|---|
|
bool |
|
Give the soma level its own synapses. A cell without dendritic levels
( |
|
bool |
|
Shunting ( |
|
bool |
|
Normalize each sample’s raw additive voltage across the layer’s outputs (zero mean, unit standard deviation); additive layers only. |
|
float |
|
Leak term of the shunting denominator (Conductance options). |
|
bool |
|
Learn the leak of every compartment (shunting only). |
|
str |
|
|
|
str |
|
Additive voltage rule: |
|
float or null |
|
Anchors of |
|
list of float |
|
Anchors of |
|
bool |
|
Recurrent cores: |
|
str |
|
Map from stored parameters to synaptic weights (Weight transforms). |
|
str |
|
Initializer of the branch-layer synaptic weights and child couplings (Synapse initialization). |
model.core.sparsity
Sparse synapse types describes each sparse synapse type and its options.
Field |
Type |
Default |
Meaning |
|---|---|---|---|
|
str |
|
Sparse synapse type (Sparse synapse types). |
|
str |
|
Constructor initializer of the sparse weights. |
|
float |
|
Noise added to the selection scores during training; |
|
int or null |
|
L-p normalization of each output’s selected weights; |
|
float |
|
Norm of the normalized inhibitory weights (excitatory weights are
normalized to 1); used with |
|
float |
|
Stochastic selection: noise scale ( |
|
bool |
|
Stochastic selection: noisy Top-K ( |
|
str |
|
|
|
str |
|
|
|
mapping |
see below |
Options of the indexed types and of |
|
mapping |
see below |
Options of |
|
mapping |
see below |
Options of |
The nested blocks accept only their own keys; other keys raise when the
config loads. Their keys and defaults are listed with the synapse types:
indexed in Indexed synapse options (the release_* keys of
indexed_release in Stochastic release), deepst in
DeepST rewiring and dense_to_sparse in
Dense-to-sparse pruning.
Training fills an unset indexed.seed from the experiment’s topology seed.
model.core.reactivation
The reactivation is the nonlinearity (gate) applied to every compartment’s voltage (Activation functions, Gate initialization and maintenance).
Field |
Type |
Default |
Meaning |
|---|---|---|---|
|
bool |
|
Apply the gate; |
|
str |
|
Gate function (Activation functions). |
|
str or null |
|
Alternative spelling of |
|
str or null |
|
Feedforward cores: a different gate for the soma stage of each
excitatory |
|
float |
|
Initial slope and midpoint of the |
|
str |
|
How the gate slope and midpoint start (Gate initialization and maintenance). |
|
float |
|
Start values used by |
|
float or null |
|
Voltage quantiles matched by |
|
float or null |
|
Gate outputs those quantiles map to (0.1 and 0.9 when null). |
|
float |
|
Smallest voltage quantile span used to fit the slope. |
|
float |
|
Largest slope a calibration sets. |
|
bool |
|
|
|
float |
|
|
|
str |
|
|
|
bool |
|
|
model.core.blocklinear
BlockLinear is the coupling from child branches to their parent
compartment.
Field |
Type |
Default |
Meaning |
|---|---|---|---|
|
str |
|
|
|
bool |
|
Use |
gradient_scaling: conductance_dynamic replaces exact backpropagation
through BlockLinear by a modified backward rule in training mode. The
forward pass is unchanged, and gradients in evaluation mode are exact. Let
\(w_{ij}\) be the coupling of child \(j\) to compartment \(i\)
and \(\bar g_i\) the batch mean of the compartment’s shunting
denominator (leak plus all conductances):
In a shunting layer the gradient of \(w_{ij}\) is multiplied by \(\bar g_i\), and the gradient passed to child \(j\) by \(\bar g_i / \max(w_{ij}, \epsilon)\).
An additive layer has no such denominator. The gradient of \(w_{ij}\) is left unchanged, and the gradient passed to child \(j\) is divided by \(w_{ij}\) (by \(|w_{ij}| + \epsilon\) with
identityweights), so each child receives its parent’s gradient as if its coupling were 1.reluweights raise, because their couplings can be zero; very smallexporsoftpluscouplings give correspondingly large gradients (infinite below about \(10^{-38}\) in float32).
\(\epsilon = 10^{-8}\) (the population field epsilon). A layer run
once per forward pass applies the scales with backward hooks on
BlockLinear; a population stepped through time registers them on the
tensors of each step, so every step uses its own scales.
model.core.implementation
Field |
Type |
Default |
Meaning |
|---|---|---|---|
|
bool |
|
|
|
str |
|
|
|
float |
|
Target total conductance of the adaptive initialization. |
|
float |
|
Initial child-to-parent coupling; other values need
|
|
float |
|
Factor on the initialized conductances; other values need
|
|
float |
|
Log-normal spread of the child couplings; positive values need
|
|
bool |
|
Log gradient statistics in the gradient-scaling hooks. |
|
bool |
|
Recurrent cores: record each layer’s per-level routing at every timestep for analysis. |
|
bool |
|
Feedforward cores: compile the forward pass with |