Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion optuna/samplers/_tpe/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@


def default_gamma(x: int) -> int:
return min(math.ceil(0.1 * x), 25)
# Avoids multiplying and calling math.ceil if result will exceed 25
gamma = 0.1 * x
if gamma >= 25:
return 25
return math.ceil(gamma)


def hyperopt_default_gamma(x: int) -> int:
Expand Down