neurodynex.leaky_integrate_and_fire package

Submodules

neurodynex.leaky_integrate_and_fire.LIF module

This file implements a leaky intergrate-and-fire (LIF) model. You can inject a step current or sinusoidal current into neuron using LIF_Step() or LIF_Sinus() methods respectively.

Relevant book chapters:

neurodynex.leaky_integrate_and_fire.LIF.LIF_Neuron(curr, simtime)[source]

Simple LIF neuron implemented in Brian2.

Parameters:
  • curr (TimedArray) – Input current injected into the neuron
  • simtime (float) – Simulation time [seconds]
Returns:

Brian2 StateMonitor with input current (I) and voltage (V) recorded

Return type:

StateMonitor

neurodynex.leaky_integrate_and_fire.LIF.LIF_Sinus(I_freq=0.1, I_offset=0.5, I_amp=0.5, tend=100, dt=0.1, do_plot=True)[source]

Run the LIF for a sinusoidal current

Parameters:
  • tend (float, optional) – the simulation time of the model [ms]
  • I_freq (float, optional) – frequency of current sinusoidal [kHz]
  • I_offset (float, optional) – DC offset of current [nA]
  • I_amp (float, optional) – amplitude of sinusoidal [nA]
  • do_plot (bool, optional) – plot the resulting simulation
Returns:

Brian2 StateMonitor with input current (I) and voltage (V) recorded

Return type:

StateMonitor

neurodynex.leaky_integrate_and_fire.LIF.LIF_Step(I_tstart=20, I_tend=70, I_amp=1.005, tend=100, do_plot=True)[source]

Run the LIF and give a step current input.

Parameters:
  • tend (float, optional) – the simulation time of the model [ms]
  • I_tstart (float, optional) – start of current step [ms]
  • I_tend (float, optional) – start of end step [ms]
  • I_amp (float, optional) – amplitude of current step [nA]
  • do_plot (bool, optional) – plot the resulting simulation
Returns:

Brian2 StateMonitor with input current (I) and voltage (V) recorded

Return type:

StateMonitor

neurodynex.leaky_integrate_and_fire.LIF.plot_data(rec, v_threshold=1.0, title=None)[source]

Plots a TimedArray for values I and v

Parameters:
  • rec (TimedArray) – the data to plot
  • v_threshold (float) – plots a threshold at this level [mV]
  • title (string) – plot title to display

Module contents