FullProjAlignPreSDMg#
- class brainpy.dyn.FullProjAlignPreSDMg(pre, syn, delay, comm, out, post, out_label=None, name=None, mode=None)[source]#
Full-chain synaptic projection with the align-pre reduction and synapse+delay updating and merging.
The
full-chainmeans that the model needs to provide all information needed for a projection, includingpre->syn->delay->comm->out->post.The
align-premeans that the synaptic variables have the same dimension as the pre-synaptic neuron group.The
synapse+delay updatingmeans that the projection first computes the synapse states, then delivers the synapse states to the delay model, and finally computes the synaptic current.The
mergingmeans that the same delay model is shared by all synapses, and the synapse model with same parameters (such like time constants) will also share the same synaptic variables.Neither
FullProjAlignPreSDMgnorFullProjAlignPreDSMgfacilitates the event-driven computation. This is because thecommis computed after the synapse state, which is a floating-point number, rather than the spiking. To facilitate the event-driven computation, please use align post projections.To simulate an E/I balanced network model:
class EINet(bp.DynSysGroup): def __init__(self): super().__init__() ne, ni = 3200, 800 self.E = bp.dyn.LifRef(ne, V_rest=-60., V_th=-50., V_reset=-60., tau=20., tau_ref=5., V_initializer=bp.init.Normal(-55., 2.)) self.I = bp.dyn.LifRef(ni, V_rest=-60., V_th=-50., V_reset=-60., tau=20., tau_ref=5., V_initializer=bp.init.Normal(-55., 2.)) self.E2E = bp.dyn.FullProjAlignPreSDMg(pre=self.E, syn=bp.dyn.Expon.desc(size=ne, tau=5.), delay=0.1, comm=bp.dnn.JitFPHomoLinear(ne, ne, prob=0.02, weight=0.6), out=bp.dyn.COBA(E=0.), post=self.E) self.E2I = bp.dyn.FullProjAlignPreSDMg(pre=self.E, syn=bp.dyn.Expon.desc(size=ne, tau=5.), delay=0.1, comm=bp.dnn.JitFPHomoLinear(ne, ni, prob=0.02, weight=0.6), out=bp.dyn.COBA(E=0.), post=self.I) self.I2E = bp.dyn.FullProjAlignPreSDMg(pre=self.I, syn=bp.dyn.Expon.desc(size=ni, tau=10.), delay=0.1, comm=bp.dnn.JitFPHomoLinear(ni, ne, prob=0.02, weight=6.7), out=bp.dyn.COBA(E=-80.), post=self.E) self.I2I = bp.dyn.FullProjAlignPreSDMg(pre=self.I, syn=bp.dyn.Expon.desc(size=ni, tau=10.), delay=0.1, comm=bp.dnn.JitFPHomoLinear(ni, ni, prob=0.02, weight=6.7), out=bp.dyn.COBA(E=-80.), post=self.I) def update(self, inp): self.E2E() self.E2I() self.I2E() self.I2I() self.E(inp) self.I(inp) return self.E.spike model = EINet() indices = bm.arange(1000) spks = bm.for_loop(lambda i: model.step_run(i, 20.), indices) bp.visualize.raster_plot(indices, spks, show=True)
- Parameters:
pre (
DynamicalSystem) – The pre-synaptic neuron group.syn (
ParamDescriber) – The synaptic dynamics.comm (
DynamicalSystem) – The synaptic communication.out (
object[DynamicalSystem,BindCondData]) – The synaptic output.post (
DynamicalSystem) – The post-synaptic neuron group.