Skip to content

Commit

Permalink
fix probabilities do not sum to 1 error
Browse files Browse the repository at this point in the history
  • Loading branch information
clement-pages committed Jun 19, 2023
1 parent bc989cd commit b4d0a78
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -679,9 +679,9 @@ def train__iter__helper(self, rng : random.Random, **filters):
embedding_files_ids = file_ids[np.in1d(file_ids, self.embedding_database_files)]

annotated_duration = self.annotated_duration[file_ids]
annotated_duration[embedding_files_ids] = 0
prob_annotated_duration = annotated_duration / np.sum(annotated_duration)
# set probability to sample a file from embedding database to 0
prob_annotated_duration[embedding_files_ids] = 0

duration = self.duration

Expand Down

0 comments on commit b4d0a78

Please sign in to comment.