jaxley.channels.Fire#

class Fire(name=None)[source]#

Bases: Channel

Mechanism to reset the voltage when it crosses a threshold.

When combined with a Leak channel, 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 heaviside function in update_states(). This allows the user to perform gradient descent on networks using this channel despite the Fire mechanism 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_spikes

False

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

Parameters:
compute_current(states, params, voltage, delta_t)[source]#

Given channel states and voltage, return the current through the channel.

Parameters:
  • states (dict[str, Array]) – All states of the compartment.

  • params (dict[str, Array]) – Parameters of the channel (conductances in S/cm2).

  • voltage (Array) – Voltage of the compartment in mV.

  • delta_t (float) – The time step in ms.

Returns:

Current in uA/cm2.

init_state(states, params, voltage, delta_t)[source]#

Initialize states of channel.

Parameters:
  • states (dict[str, Array]) – All states of the compartment.

  • params (dict[str, Array]) – Parameters of the channel (conductances in S/cm2).

  • voltage (Array) – Voltage of the compartment in mV.

  • delta_t (float) – The time step in ms.

Returns:

A initial state that is written into module.nodes when the user runs module.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:
  • states (dict[str, Array]) – All states of the compartment.

  • params (dict[str, Array]) – Parameters of the channel (conductances in S/cm2).

  • voltage (Array) – Voltage of the compartment in mV.

  • delta_t (float) – The time step in ms.

Returns:

Initial parameters that are written into module.nodes when the user runs module.init_params().

Return type:

dict[str, Array]

property name: str | None#

The name of the channel (by default, this is the class name).