adaptive-intelligent-robotics / QDax

Accelerated Quality-Diversity
https://qdax.readthedocs.io/en/latest/
MIT License
250 stars 41 forks source link

GARepertoire converts genotypes to floats aggressively #168

Open blacksph3re opened 6 months ago

blacksph3re commented 6 months ago

In the genotypes repertoire init function, a all-zero repertoire is created of the default dtype float. All following interactions with that repository silently convert genotypes to float.

If the genotypes are of another dtype like ints, this might induce problems down the line. For example, integers greater than 2**24 will not be stored correctly and very hard-to-debug problems ensue.

I don't see the reason why enforcing float dtype is necessary here.

Lookatator commented 1 month ago

Hi @blacksph3re , thank you very much for this issue. Totally agree with you! In that case, can we simply enforce the type with dtype=x.dtype?