From ce2c2700ce69d6244f7507c65f4bbded07970fe5 Mon Sep 17 00:00:00 2001 From: Philipp Stratmann <86950058+phstratmann@users.noreply.github.com> Date: Fri, 1 Mar 2024 10:20:21 +0100 Subject: [PATCH] Bug fix in Annealing neuron --- .../lib/optimization/solvers/generic/annealing/process.py | 6 ++++++ .../generic/monitoring_processes/solution_readout/models.py | 2 +- src/lava/lib/optimization/solvers/generic/nebm/models.py | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lava/lib/optimization/solvers/generic/annealing/process.py b/src/lava/lib/optimization/solvers/generic/annealing/process.py index f2b02610..97474e86 100644 --- a/src/lava/lib/optimization/solvers/generic/annealing/process.py +++ b/src/lava/lib/optimization/solvers/generic/annealing/process.py @@ -77,6 +77,12 @@ def __init__( self.delta_temperature_out = OutPort(shape=shape) self.temperature = Var(shape=shape, init=np.int_(max_temperature)) + self.steps_per_temperature = Var( + shape=shape, init=np.int_(steps_per_temperature) + ) + self.temperature_counter = Var( + shape=shape, init=np.int_(steps_per_temperature) + ) @property def shape(self) -> ty.Tuple[int, ...]: diff --git a/src/lava/lib/optimization/solvers/generic/monitoring_processes/solution_readout/models.py b/src/lava/lib/optimization/solvers/generic/monitoring_processes/solution_readout/models.py index 0e973a29..6221b9b8 100644 --- a/src/lava/lib/optimization/solvers/generic/monitoring_processes/solution_readout/models.py +++ b/src/lava/lib/optimization/solvers/generic/monitoring_processes/solution_readout/models.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 Intel Corporation +# Copyright (C) 2022-2024 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # See: https://spdx.org/licenses/ import numpy as np diff --git a/src/lava/lib/optimization/solvers/generic/nebm/models.py b/src/lava/lib/optimization/solvers/generic/nebm/models.py index c11b2ed0..683883c4 100644 --- a/src/lava/lib/optimization/solvers/generic/nebm/models.py +++ b/src/lava/lib/optimization/solvers/generic/nebm/models.py @@ -1,3 +1,7 @@ +# Copyright (C) 2022-2024 Intel Corporation +# SPDX-License-Identifier: BSD-3-Clause +# See: https://spdx.org/licenses/ + import numpy as np from lava.lib.optimization.solvers.generic.nebm.process import NEBM