DualExpon#
- class brainpy.state.DualExpon(in_size, name=None, tau_decay=Quantity(10., "ms"), tau_rise=Quantity(1., "ms"), amplitude=1.0, normalize=True, g_initializer=Constant(value=0. mS))#
Dual exponential synapse model.
This class implements a synapse model with separate rise and decay time constants, which produces a more biologically realistic conductance waveform than a single exponential model. The model is characterized by the differential equation system:
dg_rise/dt = -g_rise/tau_rise dg_decay/dt = -g_decay/tau_decay g = a * (g_decay - g_rise)
where \(a\) is a scaling factor for the output waveform.
- Parameters:
in_size (
Size) – Size of the input.name (
str, optional) – Name of the synapse instance.tau_decay (
ArrayLike, default10.0*u.ms) – Time constant of decay in milliseconds.tau_rise (
ArrayLike, default1.0*u.ms) – Time constant of rise in milliseconds.normalize (
bool, defaultTrue) – Whether to use peak normalization for the dual-exponential waveform.amplitude (
ArrayLike, default1.) – Output amplitude scaling factor. Whennormalize=True, the waveform is peak-normalized to 1 and then scaled byamplitude. Whennormalize=False, the raw difference waveform is scaled directly byamplitude.g_initializer (
ArrayLikeorCallable, defaultinit.Constant(0. * u.mS)) – Initial value or initializer for synaptic conductance.
- g_rise#
Rise component of synaptic conductance.
- Type:
HiddenState
- g_decay#
Decay component of synaptic conductance.
- Type:
HiddenState
- tau_rise#
Time constant of rise phase.
- Type:
Parameter
- tau_decay#
Time constant of decay phase.
- Type:
Parameter
- amplitude#
Output amplitude scaling factor.
- Type:
Parameter
See also
Notes
The dual exponential model produces a conductance waveform that is more physiologically realistic than a simple exponential decay, with a finite rise time followed by a slower decay.
The implementation uses an exponential Euler integration method. The output of this synapse is the difference between decay and rise components, optionally peak-normalized and scaled by
amplitude.If
normalize=True, the peak of the waveform is normalized toamplitude. Ifnormalize=False, the raw waveform is scaled directly byamplitude.This class inherits from
AlignPost, which means it can be used in projection patterns where synaptic variables are aligned with post-synaptic neurons, enabling event-driven computation and more efficient handling of sparse connectivity patterns.References
Examples
>>> import brainstate >>> import saiunit as u >>> import brainpy >>> with brainstate.environ.context(dt=0.1 * u.ms): ... syn = brainpy.state.DualExpon(in_size=1, tau_rise=0.5 * u.ms, tau_decay=5.0 * u.ms) ... syn.init_state() ... T, t0 = 300, 50 ... g = [] ... for t in range(T): ... x = (1.0 * u.mS if t == t0 else 0.0 * u.mS) ... y = u.get_magnitude(syn.update(x=x) / u.mS) ... g.append(float(y[0]))