lava.lib.dnf.inputs.rate_code_spike_gen

lava.lib.dnf.inputs.rate_code_spike_gen.models

digraph inheritancef69651d7d8 { bgcolor=transparent; rankdir=TB; size=""; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "AbstractProcessModel" [URL="../../lava/lava.magma.core.model.html#lava.magma.core.model.model.AbstractProcessModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Represents a model that implements the behavior of a Process."]; "ABC" -> "AbstractProcessModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "AbstractPyProcessModel" [URL="../../lava/lava.magma.core.model.py.html#lava.magma.core.model.py.model.AbstractPyProcessModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Abstract interface for Python ProcessModels."]; "AbstractProcessModel" -> "AbstractPyProcessModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "AbstractPyProcessModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PyLoihiProcessModel" [URL="../../lava/lava.magma.core.model.py.html#lava.magma.core.model.py.model.PyLoihiProcessModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="ProcessModel to simulate a Process on Loihi using CPU."]; "AbstractPyProcessModel" -> "PyLoihiProcessModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RateCodeSpikeGenProcessModel" [URL="../lava-lib-dnf/lava.lib.dnf.inputs.rate_code_spike_gen.html#lava.lib.dnf.inputs.rate_code_spike_gen.models.RateCodeSpikeGenProcessModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="PyLoihiProcessModel for SpikeGeneratorProcess."]; "PyLoihiProcessModel" -> "RateCodeSpikeGenProcessModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class lava.lib.dnf.inputs.rate_code_spike_gen.models.RateCodeSpikeGenProcessModel(proc_params)

Bases: PyLoihiProcessModel

PyLoihiProcessModel for SpikeGeneratorProcess.

Implements the behavior of a rate-coded spike input generator.

a_in: PyInPort = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyInPortVectorDense'>, d_type=<class 'float'>, precision=None)
first_spike_times: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'int'>, precision=None)
implements_process

alias of RateCodeSpikeGen

implements_protocol

alias of LoihiProtocol

inter_spike_distances: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'int'>, precision=None)
last_spiked: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)
min_spike_rate: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)
required_resources: ty.List[ty.Type[AbstractResource]] = [<class 'lava.magma.core.resources.CPU'>]
run_spk()

Function that runs in Spiking Phase

Return type:

None

s_out: PyOutPort = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyOutPortVectorDense'>, d_type=<class 'bool'>, precision=None)
seed: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'int'>, precision=None)
spikes: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'bool'>, precision=None)

lava.lib.dnf.inputs.rate_code_spike_gen.process

digraph inheritancefac3e67a4d { bgcolor=transparent; rankdir=TB; size=""; "AbstractProcess" [URL="../../lava/lava.magma.core.process.html#lava.magma.core.process.process.AbstractProcess",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="The notion of a Process is inspired by the Communicating Sequential"]; "RateCodeSpikeGen" [URL="../lava-lib-dnf/lava.lib.dnf.inputs.rate_code_spike_gen.html#lava.lib.dnf.inputs.rate_code_spike_gen.process.RateCodeSpikeGen",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Spike generator Process for rate-coded input."]; "AbstractProcess" -> "RateCodeSpikeGen" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class lava.lib.dnf.inputs.rate_code_spike_gen.process.RateCodeSpikeGen(**kwargs)

Bases: AbstractProcess

Spike generator Process for rate-coded input.

This process generates spike trains based on patterns it receives through its InPort a_in. It interprets these patterns as spiking rates (rate coding).

Receives a new pattern through a_in only once and while and trigger state update upon receipt of new pattern. In other time steps, receives null patterns (array full of numpy.nan). Sends spike values through its OutPort s_out every time step.

Parameters:

shape: tuple(int)

number of neurons per dimension, e.g. shape=(30, 40)

min_spike_rate: float

minimum spike rate (neurons with rates below this value will never spike)

seed: int

seed used for computing first spike times everytime pattern changes