jaxley.channels.Fire#
- class Fire(name=None)[source]#
Bases:
ChannelMechanism to reset the voltage when it crosses a threshold.
When combined with a
Leakchannel, this can be used to implement leaky-integrate-and-fire neurons.Note that, after the voltage is reset by this channel, other channels (or external currents), can still modify the membrane voltage within the same time step.
Note as well that this function implements a surrogate gradient through the use of the
heavisidefunction inupdate_states(). This allows the user to perform gradient descent on networks using this channel despite theFiremechanism being non-differentiable.The following parameters are registered in
channel_params:Name
Default
Description
Unit
Fire_vth-50.0
Threshold for firing.
mV
Fire_vreset-70.0
The reset for the voltage after a spike.
mV
The following states are registered in
channel_states:Name
Default
Description
Unit
Fire_spikesFalse
Whether or not a spike occured.
1
- Parameters:
name (str | None)
- channel_params = None#
- channel_states = None#
- current_name = None#
- update_states(states, params, voltage, delta_t)[source]#
Reset the voltage when a spike occurs and log the spike
- compute_current(states, params, voltage, delta_t)[source]#
Given channel states and voltage, return the current through the channel.
- init_state(states, params, voltage, delta_t)[source]#
Initialize states of channel.
- Parameters:
- Returns:
A initial state that is written into
module.nodeswhen the user runsmodule.init_states().
- change_name(new_name)#
Change the channel name.
- Parameters:
new_name (str) – The new name of the channel.
- Returns:
Renamed channel, such that this function is chainable.
- init_params(states, params, voltage, delta_t)#
Initialize the maximal conductances given the temperature.
- Parameters:
- Returns:
Initial parameters that are written into
module.nodeswhen the user runsmodule.init_params().- Return type: