Closed costashatz closed 6 years ago
Thanks for catching this one. To be honest I couldn't remember whether it was intentional (maybe based on some old testing), but since it is wrong wrt the comment above that states that reinjection occurs when half or more candidates have value worse than the ref, I believe this is a bug.
I've tested the change very quickly and it seems fine, of course. If you would like fix it with a PR, I'll merge it immediately.
Note that we could imagine a slightly more custom reinjection scheme by having the ratio as a user parameter.
I've tested the change very quickly and it seems fine, of course. If you would like fix it with a PR, I'll merge it immediately.
I will test it also in my cases and if nothing breaks, I will make the PR asap.
Note that we could imagine a slightly more custom reinjection scheme by having the ratio as a user parameter.
Maybe this is even better! I will make this PR then..
I have always used the condition that no single current candidate is better than the ever-best for re-injection. Unless I see evidence to the contrary, this remains to be the preferable elitist setting in my mind, because it is the least intrusive one.
OK, that makes sense, I'll provide the fix for the current bug though.
Is there a mistake in this line? I would say that
count < cols()/2
makes more sense or not?https://github.com/beniz/libcmaes/blob/fca58544296b3d34dcc8242b86f35b1f52df9f42/src/esostrategy.cc#L134