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

Python ask/tell/eval interface? #159

Open
wjaskowski opened this issue Mar 30, 2017 · 8 comments
Open

Python ask/tell/eval interface? #159

wjaskowski opened this issue Mar 30, 2017 · 8 comments

Comments

@wjaskowski
Copy link

I would like to evaluate all the candidate solutions at once (e.g., in order to coevolve them). Is that possible with the Python API?

@beniz
Copy link
Collaborator

beniz commented Mar 30, 2017

Hi, the ask/tell/eval interface is not exposed to the Python API. Have you looked at https://github.com/CMA-ES/pycma ?

@wjaskowski
Copy link
Author

wjaskowski commented Mar 30, 2017 via email

@beniz
Copy link
Collaborator

beniz commented Mar 30, 2017

Exposing C++ functions to Python API is handled in https://github.com/beniz/libcmaes/blob/master/python/lcmaes.cc
I've taken a quick look and I don't remember of any reason why I had not exposed the ask/tell/eval interface, but it is still possible that something was in the way.

If you'd like to first assess whether VD-CMA fits your need for your application, maybe you could start doing it in C++ and decide afterwards whether to add the interface ?

@wjaskowski
Copy link
Author

wjaskowski commented Mar 30, 2017 via email

@beniz
Copy link
Collaborator

beniz commented Mar 30, 2017

Optimizing deep nets with CMA ? ^^ or NES for reinforcement learning ? Curious if you can share.

@wjaskowski
Copy link
Author

wjaskowski commented Mar 31, 2017 via email

@youheiakimoto
Copy link

See https://drive.google.com/file/d/0B6Ayt4zjdvJ3Z081cGR0LXFOVkU/view for the Python implementation of VDCMA.

@nikohansen
Copy link
Collaborator

nikohansen commented May 15, 2017

This https://github.com/CMA-ES/pycma/tree/generic-sampler-improvements also contains the implementation now. The usage is yet a little verbose:

    import cma
    import cma.restricted_gaussian_sampler as rgs
    es = cma.CMAEvolutionStrategy(20 * [1], 1, {
             'CMA_sampler': rgs.GaussVkDSampler,
             # 'CMA_sampler_options': {},
             'CMA_active': False, 
             'AdaptSigma': None,
     })
    es.optimize(cma.ff.cigar)
    es.plot()

The CMA_active and AdaptSigma option settings are necessary for the time being.

There might still be a bug, which leads sometimes to somewhat strange behaviour of the GaussVDSampler, see CMA-ES/pycma#9

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

No branches or pull requests

4 participants