Skip to content

Commit

Permalink
lint format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jt2121 committed Jan 8, 2025
1 parent ed7e79f commit 0a8b8df
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions qdax/core/containers/unstructured_repertoire.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,12 @@ def intra_batch_comp(
true_positions = jnp.nonzero(eq_mask, size=eq_mask.size, fill_value=-1)[0]
tie_indices = jnp.take(knn_relevant_indices, true_positions, mode='clip')

# Instead of keeping the minimal indexed individual, we keep the first tied individual
# as encountered in knn_relevant_indices ordering.
# Instead of keeping the minimal indexed individual, we keep the first tied
# individual as encountered in knn_relevant_indices ordering.
keep_index = tie_indices[0] # First individual in the tie list

# If there's more than one individual tied, discard the current one if it's not the "keep_index"
# If there's more than one individual tied,
# discard the current one if it's not the "keep_index"
tie_discard = jnp.logical_and((tie_indices.size > 1), (current_index != keep_index))

discard_indiv = jnp.logical_or(discard_indiv, tie_discard)
Expand Down

0 comments on commit 0a8b8df

Please sign in to comment.