Expon#
- class brainpy.dyn.Expon(size, keep_size=False, sharding=None, method='exp_auto', name=None, mode=None, tau=8.0)[source]#
Exponential decay synapse model.
Model Descriptions
The single exponential decay synapse model assumes the release of neurotransmitter, its diffusion across the cleft, the receptor binding, and channel opening all happen very quickly, so that the channels instantaneously jump from the closed to the open state. Therefore, its expression is given by
\[g_{\mathrm{syn}}(t)=g_{\mathrm{max}} e^{-\left(t-t_{0}\right) / \tau}\]where \(\tau_{delay}\) is the time constant of the synaptic state decay, \(t_0\) is the time of the pre-synaptic spike, \(g_{\mathrm{max}}\) is the maximal conductance.
Accordingly, the differential form of the exponential synapse is given by
\[\begin{aligned} & \frac{d g}{d t} = -\frac{g}{\tau_{decay}}+\sum_{k} \delta(t-t_{j}^{k}). \end{aligned}\]This module can be used with interface
brainpy.dyn.ProjAlignPreMg2
, as shown in the following example:import numpy as np import brainpy as bp import brainpy.math as bm import matplotlib.pyplot as plt class ExponSparseCOBA(bp.Projection): def __init__(self, pre, post, delay, prob, g_max, tau, E): super().__init__() self.proj = bp.dyn.ProjAlignPreMg2( pre=pre, delay=delay, syn=bp.dyn.Expon.desc(pre.num, tau=tau), comm=bp.dnn.CSRLinear(bp.conn.FixedProb(prob, pre=pre.num, post=post.num), g_max), out=bp.dyn.COBA(E=E), post=post, ) class SimpleNet(bp.DynSysGroup): def __init__(self, syn_cls, E=0.): super().__init__() self.pre = bp.dyn.SpikeTimeGroup(1, indices=(0, 0, 0, 0), times=(10., 30., 50., 70.)) self.post = bp.dyn.LifRef(1, V_rest=-60., V_th=-50., V_reset=-60., tau=20., tau_ref=5., V_initializer=bp.init.Constant(-60.)) self.syn = syn_cls(self.pre, self.post, delay=None, prob=1., g_max=1., tau=5., E=E) def update(self): self.pre() self.syn() self.post() # monitor the following variables conductance = self.syn.proj.refs['syn'].g current = self.post.sum_inputs(self.post.V) return conductance, current, self.post.V
Moreover, it can also be used with interface
ProjAlignPostMg2
:class ExponSparseCOBAPost(bp.Projection): def __init__(self, pre, post, delay, prob, g_max, tau, E): super().__init__() self.proj = bp.dyn.ProjAlignPostMg2( pre=pre, delay=delay, comm=bp.dnn.EventCSRLinear(bp.conn.FixedProb(prob, pre=pre.num, post=post.num), g_max), syn=bp.dyn.Expon.desc(post.num, tau=tau), out=bp.dyn.COBA.desc(E=E), post=post, )
- Parameters:
- reset_state(batch_or_mode=None, **kwargs)[source]#
Reset function which resets local states in this model.
Simply speaking, this function should implement the logic of resetting of local variables in this node.
See https://brainpy.readthedocs.io/en/latest/tutorial_toolbox/state_resetting.html for details.