Open eddiebergman opened 1 year ago
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...
In the case where someone is using the
ask
andtell
only, there's no reason for SMAC to know about thetarget_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.
The reason for this is we are building light wrappers around some optimizers that support
ask
andtell
and not relying on SMAC to actually evaluate thetarget_function
itself.