Network

class pylgn.core.Network(memory_efficient=False)[source]

Network class

Variables:
  • neurons (list) – List with pylgn.Neuron objects
  • integrator (pylgn.Integrator) – Integrator object
  • stimulus (pylgn.Stimulus) – Stimulus object
__init__(memory_efficient=False)[source]

Network constructor

clear()[source]

Clears the neuron list.

compute_irf(neuron, recompute_ft=False)[source]

Computes the impulse-response function of a neuron.

Parameters:
  • neuron (pylgn.Neuron)
  • recompute_ft (bool) – If True the Fourier transform is recalculated.
compute_irf_ft(neuron)[source]

Computes the Fourier transform of the impulse-response function of a neuron.

Parameters:neuron (pylgn.Neuron)
compute_response(neuron, recompute_ft=False)[source]

Computes the response of a neuron.

Parameters:
  • neuron (pylgn.Neuron)
  • recompute_ft (bool) – If True the Fourier transform is recalculated.
compute_response_ft(neuron, recompute_irf_ft=False)[source]

Computes the Fourier transform of the response of a neuron.

Parameters:neuron (pylgn.Neuron)
connect(source, target, kernel, weight=1.0)[source]

Connect neurons.

Parameters:
  • source (pylgn.Neuron) – Source neuron
  • target (pylgn.Neuron) – Target neuron
  • kernel (function) – Connectivity kernel
  • weight (float) – Connectivity weight
create_cortical_cell(background_response=array(0.) * 1/s, annotations={})[source]

Create cortical cell

Parameters:
  • background_response (quantity scalar) – Background activity.
  • annotations (dict) – Dictionary with various annotations.
Returns:

out – Cortical object

Return type:

pylgn.Cortical

create_descriptive_neuron(background_response=array(0.) * 1/s, kernel=None, annotations={})[source]

Create descriptive neuron

Parameters:
  • background_response (quantity scalar) – Background activity.
  • kernel (function) – Impulse-response function.
  • annotations (dict) – Dictionary with various annotations.
Returns:

out – Descriptive neuron object

Return type:

pylgn.DescriptiveNeuron

create_ganglion_cell(background_response=array(0.) * 1/s, kernel=None, annotations={})[source]

Create ganglion cell

Parameters:
  • background_response (quantity scalar) – Background activity.
  • kernel (function) – Impulse-response function.
  • annotations (dict) – Dictionary with various annotations.
Returns:

out – Ganglion object

Return type:

pylgn.Ganglion

create_integrator(nt, nr, dt, dr)[source]

Create and set integrator

Parameters:
  • nt (int) – The power to raise 2 to. Number of temporal points is 2**nt.
  • nr (int) – The power to raise 2 to. Number of spatial points is 2**nr.
  • dt (quantity scalar) – Temporal resolution
  • dr (quantity scalar) – Spatial resolution
Returns:

out – Integrator object

Return type:

pylgn.Integrator

create_relay_cell(background_response=array(0.) * 1/s, annotations={})[source]

Create relay cell

Parameters:
  • background_response (quantity scalar) – Background activity.
  • annotations (dict) – Dictionary with various annotations.
Returns:

out – Relay object

Return type:

pylgn.Relay

set_stimulus(closure, compute_fft=False)[source]

Sets stimulus.

Parameters:
  • closure (callable (closure)) – stimulus function. If compute_fft is False the stimulus function should be the Fourier transform of the stimulus.
  • compute_fft (bool) – If True numerical integration is used to calculate the Fourier transform of the stimulus.
pylgn.core.closure_params(closure)[source]

Stores closure parameters in a dict

Parameters:closure (function) – A closure function
Returns:out – Dictionary
Return type:dict