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

MOME Container Implementation does not support non-array Genotypes #139

Closed
Lookatator opened this issue Jan 24, 2023 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@Lookatator
Copy link
Member

Lookatator commented Jan 24, 2023

Hi,

It seems the current implementation of the MOME Container does not work if the Genotype is a pytree more general than an array. For example the following line fails to run for Neural Network Genotypes:

pareto_front_genotypes=cell_genotype.squeeze(axis=0),

We have a working fix in the lab; which we will clean before submitting it in a PR :)

@Lookatator Lookatator added the bug Something isn't working label Jan 24, 2023
@limbryan
Copy link
Collaborator

I think this has been fixed and addressed now with #143 right @felixchalumeau? Where we change the explicit type in the repertoire to account for non-array genotypes and arbitrary pytrees (

lambda x: jnp.zeros(shape=(num_centroids,) + x.shape, dtype=x.dtype),
)

@Lookatator
Copy link
Member Author

Mmh from what I see, the issue still seems to be on the main and develop branches.

What I meant is cell_genotype.squeeze(axis=0) fails to run if cell_genotype is not an array.

Supposedly, the line should be:

jax.tree_util.tree_map(lambda x: x.squeeze(axis=0), cell_genotype)

And the line below: new_batch_of_genotypes=jnp.expand_dims(genotype, axis=0) should also be updated I guess.

@hannah-jan what do you think?

@Lookatator Lookatator added this to the v0.4.1 milestone Sep 5, 2024
hannah-jan added a commit to hannah-jan/QDax that referenced this issue Sep 18, 2024
@Lookatator Lookatator removed this from the v0.4.1 milestone Sep 20, 2024
Lookatator added a commit that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants