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

Can I change the dimensions of solutions during the iterations? #157

Open
meiyangjie opened this issue Nov 20, 2020 · 1 comment
Open

Can I change the dimensions of solutions during the iterations? #157

meiyangjie opened this issue Nov 20, 2020 · 1 comment

Comments

@meiyangjie
Copy link

Hi,
I want to ask a question that can I change the dimensions of solutions during the iterations?

Like the code:
import cma
xopt,es = cma.fmin2(cma.ff.rosen,8*[0],0.5)

the dimensions of the problem is set to be 8 dimensions, I try to use some kind of method like PCA to reduce the dimensions of the problem, which means the dimension of the solutions will be changed, too. Thus, can I change the dimensions of solution while the ES iterations?

Best,
Yangejie.

@nikohansen
Copy link
Contributor

nikohansen commented Nov 22, 2020

In principle yes, but there is no support from the module to do that easily online. Reducing the dimension seems algorithmically simple (in a way the 'fixed_variables' option does that statically when generating the generic initial state).

I am pretty sure an implementation should use the ask-and-tell interface instead of fmin. A workaround may be to create a new instance with reduced variables and set its state from the original instance. The CMAEvolutionStrategy._copy_light method could be used as a starting point to understand what is needed (it doesn't copy the evolution paths though). It may be as simple as adding an optional variable deletion argument to this method (akin to 'fixed_variables').

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

2 participants