Skip to content

Commit

Permalink
fix: maximum 2K samples for animation
Browse files Browse the repository at this point in the history
  • Loading branch information
frederik-encord committed Mar 1, 2024
1 parent b8cecdb commit 188a82a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clip_eval/plotting/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ def build_animation(
reduced_1 = standardize(reducer.get_reduction(defn_1))
reduced_2 = rotate_to_target(standardize(reducer.get_reduction(defn_2)), reduced_1)

if reduced_1.shape[0] > 2_000:
selection = np.random.permutation(reduced_1.shape[0])[2_000]
reduced_1 = reduced_1[selection]
reduced_2 = reduced_2[selection]

return create_embedding_chart(
reduced_1,
reduced_2,
Expand Down

0 comments on commit 188a82a

Please sign in to comment.