Skip to content

Commit

Permalink
Corrected the operation between the evolution path that should be an …
Browse files Browse the repository at this point in the history
…outer product not a dot product.

--HG--
extra : source : 4bfe1aecab5aa544fac59087c75e20bef6690fa7
  • Loading branch information
fmder committed Apr 9, 2014
1 parent b35a297 commit d219d27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deap/cma.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,10 @@ def update(self, population):
self.parent = copy.deepcopy(population[0])
if self.psucc < self.pthresh:
self.pc = (1 - self.cc)*self.pc + sqrt(self.cc * (2 - self.cc)) * x_step
self.C = (1-self.ccov)*self.C + self.ccov * numpy.dot(self.pc, self.pc.T)
self.C = (1-self.ccov)*self.C + self.ccov * numpy.outer(self.pc, self.pc)
else:
self.pc = (1 - self.cc)*self.pc
self.C = (1-self.ccov)*self.C + self.ccov * (numpy.dot(self.pc, self.pc.T) + self.cc*(2-self.cc)*self.C)
self.C = (1-self.ccov)*self.C + self.ccov * (numpy.outer(self.pc, self.pc) + self.cc*(2-self.cc)*self.C)

self.sigma = self.sigma * exp(1.0/self.d * (self.psucc - self.ptarg)/(1.0-self.ptarg))

Expand Down

0 comments on commit d219d27

Please sign in to comment.