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
Adding highest performant solution to archive #2
Comments
@valentinosPariza Thanks a lot for opening the issue! I did a few tests with your code and indeed there is a bug in the code that has the behaviour you described only if not other individuals have been added previously (i.e. the fitness is nan). If the cell was filled previously, the behaviour is as expected (you can test to add all the individuals twice for the bd 0). I am not sure why you think lines 75 or 78 contain a bug since it's more related to the indexing. The fix you proposed is indeed what I did. |
I am just including the solution I recommended before: QDax/qdax/qd_utils/grid_archive.py Line 70 in ad3953d
mask = jnp.where(maximum_fitness.at[bd_indexes].get()==eval_scores,True,False)
to_be_added = jnp.logical_and(better_fitness + current_fitness_nan, mask) Thanks for your response @maxiallard In the beginning I thought that it was an issue with the indexing, but after further investigation, I found exactly what you mentioned and I was just ready to fix my issue identification explanation. I think my point of indexing was valid since at the end the code was allowing solutions with non-maximum evaluation score to be mapped to the same index. That is, their index was not converted to the out-of bounds index. But, indeed as you mentioned the issue was not exactly in lines 75 and 78, and that was the misconception I had at the beginning. |
Excellent! Thanks a lot for the quick reply @valentinosPariza . I pushed the fix, maybe you can check whether it works for you now. Regarding the indexing, the sorting wouldn't have solved our issues so that's why we used the |
Great, thanks a lot for the update and for the fixes. Yes, you are right. Indexing is not the same for jax.Numpy as for NumPy. Thanks again. |
Hello, I have been working with QDax and I think I encountered an issue regarding which solutions are stored in the archive
based on their evaluation scores. That is, it seems like there is a chance that not the highest performant solution will be stored in the archive.
QDax/qdax/qd_utils/grid_archive.py
Line 75 in ad3953d
More precisely, please execute the following code and trace which solution is stored in the archive at the end as generated in the line
QDax/qdax/qd_utils/grid_archive.py
Line 78 in ad3953d
The code:
The result I get:
You can change the behavioural descriptors to any other values that would map to the same position and the same issue still exists. That is, this doesn't seem to happen on position 0 of the archive array only.
The text was updated successfully, but these errors were encountered: