Skip to content

Commit

Permalink
[TPA] fix missing rescaling in second iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
nikohansen committed Oct 9, 2024
1 parent 037c10d commit 384e8ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cma/evolution_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ def ask_geno(self, number=None, xmean=None, sigma_fac=1):
arinj.append(y)
while self.pop_injection_solutions:
arinj.append((self.pop_injection_solutions.pop(0) - self.mean) / self.sigma)
if self.mean_shift_samples and self.countiter > 1:
if self.mean_shift_samples and (self.countiter > 1 or len(arinj) > 1):
# TPA is implemented by injection of the Delta mean
if len(arinj) < 2:
raise RuntimeError(
Expand Down

0 comments on commit 384e8ce

Please sign in to comment.