lava.lib.dnf.inputs.gauss_pattern
lava.lib.dnf.inputs.gauss_pattern.models

- class lava.lib.dnf.inputs.gauss_pattern.models.GaussPatternProcessModel(proc_params=None)
Bases:
PyLoihiProcessModel
PyLoihiProcessModel for GaussPatternProcess.
Implements the behavior of sending a gauss pattern asynchronously when a change is triggered.
- a_out: PyOutPort = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyOutPortVectorDense'>, d_type=<class 'float'>, precision=None)
- changed: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'bool'>, precision=None)
- implements_process
alias of
GaussPattern
- implements_protocol
alias of
LoihiProtocol
- null_pattern: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)
- pattern: 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
lava.lib.dnf.inputs.gauss_pattern.process

- class lava.lib.dnf.inputs.gauss_pattern.process.GaussPattern(**kwargs)
Bases:
AbstractProcess
Gauss pattern generator Process.
This process generates Gauss patterns and send them through the OutPort a_out. It recomputes new patterns and sends them asynchronously only when one of the parameters amplitude, mean or stddev changes. Otherwise, sends an array full of numpy.nan.
Parameters:
- shape: tuple(int)
number of neurons per dimension, e.g. shape=(30, 40)
- amplitude: float
amplitude of the Gauss pattern
- mean: list(float) or float
mean of the Gauss pattern
- stddev: list(float) or float
standard deviation of the Gauss pattern
- property amplitude: Optional[ndarray]
Get value of the amplitude Var
- Returns
amplitude
- Return type
numpy.ndarray
- property mean: Optional[ndarray]
Get value of the mean Var
- Returns
mean
- Return type
numpy.ndarray
- property shape: Optional[ndarray]
Get value of the shape Var
- Returns
shape
- Return type
numpy.ndarray
- property stddev: Optional[ndarray]
Get value of the stddev Var
- Returns
stddev
- Return type
numpy.ndarray