Open chielk opened 6 years ago
On line 154 the result of list of lists - numpy.array is a numpy.array.
What error do you get?
I currently don't have time to work on this, maybe later, but IIRC I would get something like "operands could not be broadcast together" unless I chose a mu equal to the dimensionality of the solution space. When I did do that, it would strangely give the same error, but only after multiple generations.
The population in cma.py -> update is assumed to be an iterable of objects that contain a .fitness attribute (line 130), but on line 158 .T is called on it, suggesting it is a numpy matrix. This causes errors under most (but not all) conditions, like when mu is not equal to the dimensionality of the search space.
A possible way to remedy this is to transform it to an array after sorting:
population = numpy.array([ind[:] for ind in population])
This seems to work on my code, but may not be compatible with how other people have represented the population.