From 050f56a8b288c5ee33d7eabadaf8d35726504e37 Mon Sep 17 00:00:00 2001 From: Servon Date: Tue, 3 Aug 2021 18:05:39 +0800 Subject: [PATCH] fix same pointer bug --- zoopt/algos/opt_algorithms/racos/racos_classification.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zoopt/algos/opt_algorithms/racos/racos_classification.py b/zoopt/algos/opt_algorithms/racos/racos_classification.py index bead4c5..d1d23b7 100644 --- a/zoopt/algos/opt_algorithms/racos/racos_classification.py +++ b/zoopt/algos/opt_algorithms/racos/racos_classification.py @@ -38,7 +38,10 @@ def __init__(self, dim, positive, negative, ub=1): self.__x_positive = None self.__uncertain_bit = ub - self.__sample_region = copy.deepcopy(dim.get_regions()) + regions = dim.get_regions() + for i in range(dim.get_size()): + temp = [regions[i][0], regions[i][1]] + self.__sample_region.append(temp) def reset_classifier(self): """