align_pre_projection#
- class brainpy.state.align_pre_projection(*spike_generator, syn, comm, out, post, stp=None)#
Pre-synaptic alignment projection with spike generation.
A convenience wrapper that combines spike generation, optional short-term plasticity (STP), pre-synaptic synapse dynamics, and a
CurrentProjinto a single module. The synapse operates in pre-synaptic space, processing spikes before the communication step transmits them to post-synaptic neurons.The update pipeline is:
Spike generator modules produce binary spike signals.
If STP is provided, spikes are modulated by short-term plasticity dynamics.
The pre-synaptic synapse model filters the (modulated) spikes.
The
CurrentProjmaps the filtered signal to post-synaptic current.
- Parameters:
*spike_generator – One or more modules that produce spike signals from the input.
syn (
Dynamics) – Pre-synaptic synapse dynamics (e.g.,Expon).comm (
Callable) – Communication module mapping pre-synaptic to post-synaptic space.out (
SynOut) – Synaptic output module.post (
Dynamics) – Post-synaptic neural population.stp (
Dynamics, optional) – Short-term plasticity module applied after spike generation.
See also
align_post_projectionPost-synaptic alignment variant.
CurrentProjUnderlying current projection used internally.
AlignPostProjAlternative projection with post-synaptic alignment.
Notes
Pre-synaptic alignment means the synapse state lives in pre-synaptic space. This is natural for models where synaptic filtering (e.g., exponential decay) should happen before the communication step.
Spike signals are wrapped in
brainevent.BinaryArrayfor efficient event-driven processing.When STP is used, its output is wrapped in
brainevent.MaskedFloatto preserve sparsity.
Examples
>>> import brainpy >>> import brainstate >>> import saiunit as u >>> pre = brainpy.state.LIF(800, tau=20.*u.ms) >>> post = brainpy.state.LIF(200, tau=20.*u.ms) >>> pre.init_state() >>> post.init_state() >>> proj = brainpy.state.align_pre_projection( ... pre, ... syn=brainpy.state.Expon(800, tau=5.*u.ms), ... comm=brainstate.nn.Linear(800, 200), ... out=brainpy.state.CUBA(scale=u.volt), ... post=post, ... )