6

In my setting I have an abstract situation like this the following, just note this is not about power calculation but a simple example to explain my point.

base = trial.suggest_int(1, 3)
power = trial.suggest_int(1, 10)

As when the base == 1 the power parameter becomes irrelevant and I would like to fix it to 1.

For example:

base = trial.suggest_int("base", 1, 3)
if base == 1:
   # Different distribution! But still inside the other.
   power = trial.suggest_int("power", 1, 1) 
else:
   power = trial.suggest_int("power", 1, 10)

While this works it creates later problems in the form of ValueErrors because the underlying distributions are not the same.


How can I suggest a fixed value with the same parameter name that depends on another value that is sampled within the trial?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.