Skip to content

Commit

Permalink
Merge pull request #12 from austin-bowen/patch-2
Browse files Browse the repository at this point in the history
Replace random.uniform(0, 1) with faster equivalent random.random()
  • Loading branch information
asmith26 authored Feb 13, 2023
2 parents f7bf053 + 137b1fc commit e3d5084
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vose_sampler/vose_sampler.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def alias_generation(self):
col = self.rng.choice(self.table_prob_list)

# Determine which outcome to pick in that column
if self.table_prob[col] >= self.rng.uniform(0,1):
if self.table_prob[col] >= self.rng.random():
return col
else:
return self.table_alias[col]
Expand Down

0 comments on commit e3d5084

Please sign in to comment.