Skip to content

Commit

Permalink
refactor: Delete unnecessary max operation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryota717 committed Oct 11, 2024
1 parent f806fbb commit e4ad3bb
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 e4ad3bb

Please sign in to comment.