Skip to content

Commit

Permalink
changed termination strategy, now allowing per run termination
Browse files Browse the repository at this point in the history
  • Loading branch information
TimRoith committed Feb 13, 2024
1 parent 26af566 commit 6b02c0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cbx/dynamics/pdyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def init_term(self, term_criteria, max_it):
"""
self.term_criteria = term_criteria if term_criteria is not None else [max_it_term(max_it)]
self.term_reason = np.zeros((self.M), dtype=int)
self.term_reason = [None for i in range((self.M))]
self.active_runs_idx = np.arange(self.M)
self.num_active_runs = self.M

Expand Down Expand Up @@ -856,7 +856,7 @@ def reset(self,):
self.t = 0.

def eval_f(self, x):
self.num_f_eval += np.ones(self.M, dtype=int) * x.shape[-2] # update number of function evaluations
self.num_f_eval[self.active_runs_idx] += x.shape[-2] # update number of function evaluations
return self.f(x)

def print_cur_state(self,):
Expand Down

0 comments on commit 6b02c0a

Please sign in to comment.