Skip to content

Commit

Permalink
non zero random
Browse files Browse the repository at this point in the history
  • Loading branch information
djstrong committed Jan 22, 2024
1 parent 9f4918f commit 777116b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion generator/sampling/weighted_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self, config: DictConfig, pipelines: list[Pipeline], weights: dict[
# self.first_pass = get_numpy_rng().choice(list(self.weights.keys()), len(self.weights),
# p=normalized_weights, replace=False).tolist()
self.first_pass = [x[1] for x in sorted(
[(math.log(get_random_rng().random()) / weight, k) for k, weight in self.weights.items()], reverse=True)]
[(math.log(1 - get_random_rng().random()) / weight, k) for k, weight in self.weights.items()], reverse=True)]
else:
self.first_pass = []

Expand Down

0 comments on commit 777116b

Please sign in to comment.