Skip to content

Commit

Permalink
Merge pull request #164 from ryota717/refactor-mab
Browse files Browse the repository at this point in the history
small refactor in `mab_epsilon_greedy`
  • Loading branch information
nabenabe0928 authored Oct 15, 2024
2 parents f806fbb + e4ad3bb commit 7892786
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/samplers/mab_epsilon_greedy/mab_epsilon_greedy.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ def sample_independent(
if study.direction == StudyDirection.MINIMIZE:
return min(
param_distribution.choices,
key=lambda x: rewards_by_choice[x] / max(cnt_by_choice[x], 1),
key=lambda x: rewards_by_choice[x] / cnt_by_choice[x],
)
else:
return max(
param_distribution.choices,
key=lambda x: rewards_by_choice[x] / max(cnt_by_choice[x], 1),
key=lambda x: rewards_by_choice[x] / cnt_by_choice[x],
)

0 comments on commit 7892786

Please sign in to comment.