lava.proc.sdn

lava.proc.sdn.models

Inheritance diagram of lava.proc.sdn.models
class lava.proc.sdn.models.AbstractDeltaModel(proc_params=None)

Bases: PyLoihiProcessModel

a_in = None
act = None
cum_error = None
delta_dynamics(act_data)

Delta encodind dynamics method

Parameters

act_data (np.ndarray) – data to be encoded

Returns

delta encoded data

Return type

np.ndarray

error = None
model_id: ty.Optional[int]
proc_params: ty.Type['ProcessParameters']
process_to_service: ty.Optional[CspSendPort]
py_ports: ty.List[AbstractPyPort]
residue = None
s_out = None
service_to_process: ty.Optional[CspRecvPort]
spike_exp = None
state_exp = None
var_id_to_var_map: ty.Dict[int, ty.Any]
var_ports: ty.List[PyVarPort]
vth = None
class lava.proc.sdn.models.AbstractSigmaDeltaModel(proc_params)

Bases: AbstractSigmaModel, AbstractDeltaModel

a_in = None
act = None
activation_dynamics(sigma_data)

Sigma Delta activation dynamics. UNIT and RELU activations are supported.

Parameters

sigma_data (np.ndarray) – sigma decoded data

Returns

activation output

Return type

np.ndarray

Raises

NotImplementedError – if activation mode other than UNIT or RELU is encountered.

bias = None
cum_error = None
dynamics(a_in_data)
Return type

ndarray

error = None
model_id: ty.Optional[int]
proc_params: ty.Type['ProcessParameters']
process_to_service: ty.Optional[CspSendPort]
py_ports: ty.List[AbstractPyPort]
residue = None
s_out = None
service_to_process: ty.Optional[CspRecvPort]
sigma = None
spike_exp = None
state_exp = None
var_id_to_var_map: ty.Dict[int, ty.Any]
var_ports: ty.List[PyVarPort]
vth = None
class lava.proc.sdn.models.AbstractSigmaModel(proc_params=None)

Bases: PyLoihiProcessModel

a_in = None
a_out = None
model_id: ty.Optional[int]
proc_params: ty.Type['ProcessParameters']
process_to_service: ty.Optional[CspSendPort]
py_ports: ty.List[AbstractPyPort]
run_spk()

Function that runs in Spiking Phase

Return type

None

service_to_process: ty.Optional[CspRecvPort]
sigma = None
sigma_dynamics(a_in_data)

Sigma decoding dynamics method

Parameters

a_in_data (np.ndarray) – Input data

Returns

decoded data

Return type

np.ndarray

var_id_to_var_map: ty.Dict[int, ty.Any]
var_ports: ty.List[PyVarPort]
class lava.proc.sdn.models.PyDeltaModelFixed(proc_params=None)

Bases: AbstractDeltaModel

Fixed point implementation of Delta encoding.

a_in = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyInPortVectorDense'>, d_type=<class 'numpy.int32'>, precision=24)
act: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=24)
cum_error: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'bool'>, precision=1)
error: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=24)
implements_process

alias of Delta

implements_protocol

alias of LoihiProtocol

required_resources: ty.List[ty.Type[AbstractResource]] = [<class 'lava.magma.core.resources.CPU'>]
residue: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=24)
run_spk()

Function that runs in Spiking Phase

Return type

None

s_out = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyOutPortVectorDense'>, d_type=<class 'numpy.int32'>, precision=24)
sigma: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=24)
spike_exp: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=3)
state_exp: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=3)
tags: ty.List[str] = ['fixed_pt']
vth: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=24)
class lava.proc.sdn.models.PyDeltaModelFloat(proc_params=None)

Bases: AbstractDeltaModel

Floating point implementation of Delta encoding.

a_in = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyInPortVectorDense'>, d_type=<class 'float'>, precision=None)
act: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)
cum_error: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'bool'>, precision=1)
error: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)
implements_process

alias of Delta

implements_protocol

alias of LoihiProtocol

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

Function that runs in Spiking Phase

Return type

None

s_out = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyOutPortVectorDense'>, d_type=<class 'float'>, precision=None)
sigma: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)
spike_exp: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=3)
state_exp: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=3)
tags: ty.List[str] = ['floating_pt']
vth: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)
class lava.proc.sdn.models.PySigmaDeltaModelFixed(proc_params)

Bases: AbstractSigmaDeltaModel

Fixed point implementation of Sigma Delta neuron.

a_in = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyInPortVectorDense'>, d_type=<class 'numpy.int32'>, precision=24)
act: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=24)
bias: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=16)
cum_error: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'bool'>, precision=1)
error: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=24)
implements_process

alias of SigmaDelta

implements_protocol

alias of LoihiProtocol

required_resources: ty.List[ty.Type[AbstractResource]] = [<class 'lava.magma.core.resources.CPU'>]
residue: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=24)
run_spk()

Function that runs in Spiking Phase

Return type

None

s_out = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyOutPortVectorDense'>, d_type=<class 'numpy.int32'>, precision=24)
sigma: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=24)
spike_exp: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=3)
state_exp: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=3)
tags: ty.List[str] = ['fixed_pt']
vth: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=24)
class lava.proc.sdn.models.PySigmaDeltaModelFloat(proc_params)

Bases: AbstractSigmaDeltaModel

Floating point implementation of Sigma Delta neuron.

a_in = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyInPortVectorDense'>, d_type=<class 'float'>, precision=None)
act: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)
bias: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)
cum_error: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'bool'>, precision=1)
error: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)
implements_process

alias of SigmaDelta

implements_protocol

alias of LoihiProtocol

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

Function that runs in Spiking Phase

Return type

None

s_out = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyOutPortVectorDense'>, d_type=<class 'float'>, precision=None)
sigma: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)
spike_exp: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=3)
state_exp: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=3)
tags: ty.List[str] = ['floating_pt']
vth: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)
class lava.proc.sdn.models.PySigmaModelFixed(proc_params=None)

Bases: AbstractSigmaModel

Fixed point implementation of Sigma decoding

a_in = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyInPortVectorDense'>, d_type=<class 'numpy.int32'>, precision=24)
implements_process

alias of Sigma

implements_protocol

alias of LoihiProtocol

required_resources: ty.List[ty.Type[AbstractResource]] = [<class 'lava.magma.core.resources.CPU'>]
s_out = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyOutPortVectorDense'>, d_type=<class 'numpy.int32'>, precision=24)
sigma: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=24)
tags: ty.List[str] = ['fixed_pt']
class lava.proc.sdn.models.PySigmaModelFloat(proc_params=None)

Bases: AbstractSigmaModel

Floating point implementation of Sigma decoding

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

alias of Sigma

implements_protocol

alias of LoihiProtocol

required_resources: ty.List[ty.Type[AbstractResource]] = [<class 'lava.magma.core.resources.CPU'>]
s_out = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyOutPortVectorDense'>, d_type=<class 'float'>, precision=None)
sigma: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)
tags: ty.List[str] = ['floating_pt']
lava.proc.sdn.models.ReLU(x)

ReLU activation implementation

Parameters

x (np.ndarray) – input array

Returns

output array

Return type

np.ndarray

lava.proc.sdn.process

Inheritance diagram of lava.proc.sdn.process
class lava.proc.sdn.process.ActivationMode(value)

Bases: IntEnum

Enum for synapse sigma delta activation mode. Options are UNIT: 0 RELU: 1

RELU = 1
UNIT = 0
class lava.proc.sdn.process.Delta(*, shape, vth, cum_error=False, spike_exp=0, state_exp=0)

Bases: AbstractProcess

property shape: Tuple[int, ...]

Return shape of the Process.

Return type

Tuple[int, ...]

class lava.proc.sdn.process.Sigma(*, shape)

Bases: AbstractProcess

property shape: Tuple[int, ...]

Return shape of the Process.

Return type

Tuple[int, ...]

class lava.proc.sdn.process.SigmaDelta(*, shape, vth, bias=0, act_mode=ActivationMode.RELU, cum_error=False, spike_exp=0, state_exp=0)

Bases: AbstractProcess

property shape: Tuple[int, ...]

Return shape of the Process.

Return type

Tuple[int, ...]