lava.lib.optimization.solvers.generic.monitoring_processes.solution_readout
lava.lib.optimization.solvers.generic.monitoring_processes.solution_readout.models
digraph inheritance3e33676b51 { 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)"]; "SolutionReadoutPyModel" [URL="../lava-lib-optimization/lava.lib.optimization.solvers.generic.monitoring_processes.solution_readout.html#lava.lib.optimization.solvers.generic.monitoring_processes.solution_readout.models.SolutionReadoutPyModel",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="CPU model for the SolutionReadout process."]; "PyLoihiProcessModel" -> "SolutionReadoutPyModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; }- class lava.lib.optimization.solvers.generic.monitoring_processes.solution_readout.models.SolutionReadoutPyModel(proc_params=None)
Bases:
PyLoihiProcessModel
CPU model for the SolutionReadout process. The process receives two types of messages, an updated cost and the state of the solver network representing the current candidate solution to an OptimizationProblem. Additionally, a target cost can be defined by the user, once this cost is reached by the solver network, this process will request the runtime service to pause execution.
-
cost_in:
PyInPort
= LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyInPortVectorDense'>, d_type=<class 'numpy.int32'>, precision=32)
- static decode_cost(raw_cost)
- Return type:
ndarray
- static decode_solution(raw_solution, time_steps_per_algorithmic_step)
- Return type:
ndarray
- implements_process
alias of
SolutionReadout
- implements_protocol
alias of
LoihiProtocol
-
min_cost:
ndarray
= LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=32)
-
read_solution:
PyInPort
= LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyInPortVectorDense'>, d_type=<class 'numpy.int32'>, precision=32)
- required_resources: ty.List[ty.Type[AbstractResource]] = [<class 'lava.magma.core.resources.CPU'>]
- run_spk()
Function that runs in Spiking Phase
-
solution:
ndarray
= LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=32)
-
solution_step:
ndarray
= LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=32)
- stop = False
-
target_cost:
int
= LavaPyType(cls=<class 'int'>, d_type=<class 'numpy.int32'>, precision=32)
-
time_steps_per_algorithmic_step:
ndarray
= LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'numpy.int32'>, precision=32)
-
cost_in:
lava.lib.optimization.solvers.generic.monitoring_processes.solution_readout.process
digraph inheritance093968d846 { 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"]; "SolutionReadout" [URL="../lava-lib-optimization/lava.lib.optimization.solvers.generic.monitoring_processes.solution_readout.html#lava.lib.optimization.solvers.generic.monitoring_processes.solution_readout.process.SolutionReadout",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="Process to readout solution from SNN and make it available on host."]; "AbstractProcess" -> "SolutionReadout" [arrowsize=0.5,style="setlinewidth(0.5)"]; }- class lava.lib.optimization.solvers.generic.monitoring_processes.solution_readout.process.SolutionReadout(shape, target_cost=None, time_steps_per_algorithmic_step=1, name=None, log_config=None)
Bases:
AbstractProcess
Process to readout solution from SNN and make it available on host.
- Parameters:
shape (The shape of the set of nodes, or process, which state will be read.) –
target_cost (cost value at which, once attained by the network,) –
execution. (this process will stop) –
name (Name of the Process. Default is 'Process_ID', where ID is an) –
automatically. (integer value that is determined) –
log_config (Configuration options for logging.) –
time_steps_per_algorithmic_step (the number of iteration steps that a) –
the (single algorithmic step requires. This value is required to decode) –
process. (variable values from the spk_hist of a) –
- read_solution
A message received on this ports signifies the process should call read on its RefPort.
- Type:
- ref_port
A reference port to a variable in another process which state will be remotely accessed upon read request. Here, it reads the current variables assignment by a solver to an optimization problem.
- Type: