API reference
Synaptic efficacy banks
Signatures, parameters, return contracts, and source for synaptic efficacy banks.
Overview
An efficacy bank contains one positive multiplier for each retained incoming E/I contact slot. The retained width is 2*ceil(channels_per_role/recurrent_stride). W8 storage quantizes deviation around a positive baseline with one shared scale; dequantization reconstructs floating-point multipliers.
Source revision: caef7be03abd. Public export index.
QuantizedSynapticEfficacyBank
axosim.synapse.QuantizedSynapticEfficacyBank(values: torch.Tensor, scale: torch.Tensor, channels_per_role: int, recurrent_stride: int, baseline: float = 1.0)
One W8 multiplicative efficacy for every retained incoming contact.
Parameters
valuestorch.Tensor- required. Physical quantized values, interpreted using the bank's scale and layout metadata.
scaletorch.Tensor- required. Multiplicative normalization or reconstruction scale.
channels_per_roleint- required. Available contact-channel slots for each E/I role.
recurrent_strideint- required. Stride selecting retained contact slots.
baselinefloat- default=1.0. Positive shared reference efficacy for deviation quantization.
Attributes
Constructor fields are retained as read-only attributes.
Read-only attributes
QuantizedSynapticEfficacyBank.population_size: int- Number of persistent neurons. Source
QuantizedSynapticEfficacyBank.values_per_neuron: int- Logical retained-contact multiplier count per neuron. Source
QuantizedSynapticEfficacyBank.storage_bytes: int- Physical bank storage, including quantized values and reconstruction scales. Source
retained_synaptic_efficacies_per_neuron
axosim.synapse.retained_synaptic_efficacies_per_neuron(*, channels_per_role: int, recurrent_stride: int) -> int
Return compact E/I contact slots for the declared routed topology.
Parameters
channels_per_roleint- keyword-only, required. Available contact-channel slots for each E/I role.
recurrent_strideint- keyword-only, required. Stride selecting retained contact slots.
Returns
int
quantize_synaptic_efficacies
axosim.synapse.quantize_synaptic_efficacies(efficacies: torch.Tensor, *, channels_per_role: int, recurrent_stride: int, baseline: float=1.0) -> QuantizedSynapticEfficacyBank
Quantize positive per-contact multipliers around a shared baseline.
efficacies is floating-point (N,2*ceil(channels_per_role/recurrent_stride)) with all values positive. Returns a W8 bank containing int8 values, one colocated floating scale, topology metadata, and positive baseline.
Parameters
efficaciestorch.Tensor- required. Positive floating-point contact multipliers, shaped by the retained topology.
channels_per_roleint- keyword-only, required. Available contact-channel slots for each E/I role.
recurrent_strideint- keyword-only, required. Stride selecting retained contact slots.
baselinefloat- keyword-only, default=1.0. Positive shared reference efficacy for deviation quantization.
Returns
bankQuantizedSynapticEfficacyBank- W8 values, one shared scale, positive baseline, and retained topology metadata.
Examples
Quantize a unit-efficacy bank with four retained slots per E/I role.
import torch
from axosim.synapse import quantize_synaptic_efficacies
bank = quantize_synaptic_efficacies(
torch.ones(2, 8), channels_per_role=4, recurrent_stride=1
)
print(bank.values.shape, bank.values.dtype)
torch.Size([2, 8]) torch.int8
dequantize_synaptic_efficacies
axosim.synapse.dequantize_synaptic_efficacies(bank: QuantizedSynapticEfficacyBank) -> torch.Tensor
Materialize a W8 efficacy bank for training checks or export.
Returns floating-point (N,K) values reconstructed as bank.values*bank.scale+bank.baseline. Validates the bank’s layout and scale device.
Parameters
bankQuantizedSynapticEfficacyBank- required. Quantized bank including its scale and layout metadata.
Returns
efficaciestorch.Tensor- Reconstructed floating-point contact multipliers with shape (population, retained_contacts).