From 0b1675de6fb96444810a88cd6b9014aeaad7b8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaquier=20Aur=C3=A9lien=20Tristan?= Date: Tue, 9 May 2023 17:14:36 +0200 Subject: [PATCH] Fix tsodyksmarkramstp example --- examples/tsodyksmarkramstp/tmevaluator.py | 4 ++++ examples/tsodyksmarkramstp/tmevaluator_multiplefreqs.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/examples/tsodyksmarkramstp/tmevaluator.py b/examples/tsodyksmarkramstp/tmevaluator.py index db08bb75..7b6e634d 100644 --- a/examples/tsodyksmarkramstp/tmevaluator.py +++ b/examples/tsodyksmarkramstp/tmevaluator.py @@ -82,3 +82,7 @@ def evaluate_with_lists(self, individual): errors = [np.linalg.norm(self.v[t0:t1] - candidate_v[t0:t1]) for t0, t1 in self.split_idx] return errors + + def init_simulator_and_evaluate_with_lists(self, individual): + """Calls evaluate_with_lists. Is called during IBEA optimisation.""" + return self.evaluate_with_lists(individual) diff --git a/examples/tsodyksmarkramstp/tmevaluator_multiplefreqs.py b/examples/tsodyksmarkramstp/tmevaluator_multiplefreqs.py index c79d96e7..42e2b877 100644 --- a/examples/tsodyksmarkramstp/tmevaluator_multiplefreqs.py +++ b/examples/tsodyksmarkramstp/tmevaluator_multiplefreqs.py @@ -69,3 +69,7 @@ def evaluate_with_lists(self, individual): candidate_amps, _ = self.generate_model(freq, individual) errors.extend(np.power(self.amplitudes[freq] - candidate_amps, 2).tolist()) return errors + + def init_simulator_and_evaluate_with_lists(self, individual): + """Calls evaluate_with_lists. Is called during IBEA optimisation.""" + return self.evaluate_with_lists(individual)