From 14f30f34e59e37a6d03b7e7763e6ba271c2b019c Mon Sep 17 00:00:00 2001 From: LisaCoiffard <91796648+LisaCoiffard@users.noreply.github.com> Date: Fri, 20 Sep 2024 18:12:40 +0100 Subject: [PATCH] fix: Change indexing in UnstructuredRepertoire intra batch comp (#185) * change indexing to retrieve current fitness in intra batch comp Authored-by: Lisa --- qdax/core/containers/unstructured_repertoire.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qdax/core/containers/unstructured_repertoire.py b/qdax/core/containers/unstructured_repertoire.py index 8512d3d6..4a1c0cdb 100644 --- a/qdax/core/containers/unstructured_repertoire.py +++ b/qdax/core/containers/unstructured_repertoire.py @@ -110,9 +110,7 @@ def intra_batch_comp( # We want to eliminate the same individual (distance 0) fitness = jnp.where(knn_relevant_indices == current_index, False, fitness) - current_fitness = jnp.squeeze( - eval_scores.at[knn_relevant_indices.at[0].get()].get() - ) + current_fitness = jnp.squeeze(eval_scores.at[current_index].get()) # Is the fitness of the other individual higher? # If both are True then we discard the current individual since this individual