Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid C update with negative weights for (bad) injected solutions #124

Closed
nikohansen opened this issue Apr 2, 2020 · 1 comment
Closed

Comments

@nikohansen
Copy link
Contributor

Injecting always the same arbitrary bad solution twice or more often leads to a failure, similar to the one observe here

es = cma.CMAEvolutionStrategy(8 * [5], 10, {'ftarget': 1e-9,
                                           #'CMA_active': 0,
                                          })
fit = cma.ff.sphere
while not es.stop():
    X = es.ask()
    F = [fit(x) for x in X]
    es.tell(X, F)
    es.inject(2 * [es.N * [100]])
    es.disp(300)
    es.logger.add()
cma.plot(xsemilog=True);

A simple fix is to turn off 'CMA_active'. A (much) better fix would be to catch the points that don't comply with the sample distribution (as is already done) and ignore them in the update of the covariance matrix if they are bad (needs to be done).

@nikohansen
Copy link
Contributor Author

Fixed in the upcoming release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant