nervos.examples package#

Submodules#

nervos.examples.neuron_spiking module#

class nervos.examples.neuron_spiking.ExampleCurrentThroughLIFNeuron(parameters)[source]#

Bases: object

Simulates current injection into a Leaky Integrate-and-Fire (LIF) neuron.

This class models the response of a single LIF neuron to a square current pulse and visualizes the resulting membrane potential and input current over time.

parameters#

Configuration for the neuron (resting potential, threshold, etc.).

Type:

Parameters

neuron#

Instance of the LIF neuron.

Type:

LIFNeuron

dt#

Simulation time step in milliseconds.

Type:

float

simulation_duration#

Total simulation time in milliseconds.

Type:

int

clock#

Discrete time steps for the simulation.

Type:

np.ndarray

simulate_pulse(current_magnitude)[source]#

Simulates the response of the LIF neuron to a square current pulse.

A current of specified magnitude is applied briefly during the simulation. The resulting membrane potential and input current are plotted.

Parameters:

current_magnitude (float) – Magnitude of the input current in nanoamperes (nA).

Returns:

None

Module contents#

This package provides examples for simulating the behavior of spiking neural networks.

The included example demonstrates how to model and simulate the response of a Leaky Integrate-and-Fire (LIF) neuron to a current pulse. The simulation tracks the neuron’s membrane potential over time and visualizes the results.

Submodules:
  • ExampleCurrentThroughLIFNeuron: Class that simulates the behavior of an LIF neuron under an input current pulse, and generates plots of membrane potential and input current.