SMAC3
SMAC3 copied to clipboard
[Feature] Remove `target_function` as required when using `ask` and `tell` interface
In the case where someone is using the ask
and tell
only, there's no reason for SMAC to know about the target_function
at hand, however it's required by the abstract facade.
I can get around this pretty easily as I'm familiar enough with SMAC but it would nice not to have to do these hacky work-arounds.
optimizer = HyperparameterOptimizationFacade(
scenario=Scenario(...),
target_function="dummy" # Smac things this is a program it should run
)
The reason for this is we are building light wrappers around some optimizers that support ask
and tell
and not relying on SMAC to actually evaluate the target_function
itself.
One possible way to do this is have a "lazy" instantiated runner via a @property
such that the runner is only defined once required, at which point it will be detected that there is no target_function
and a suitable error can be raised.
Another possibility is to have None
be allowed as a possible value to target_function
which can be detected at the point of optimize
, raising a suitable error if None
is provided, otherwise instantiating a runner at the optimize call.
Some combination of these solutions would probably be required as the SMBO
object is created in the __init__
, passing the desired Runner
to the SMBO
object.
The None
option sounds decent. Haven't thought about that - thanks for pointing out :)
@benjamc bump. Turns out it's from quite a few months ago...