automl / neps

Neural Pipeline Search (NePS): Helps deep learning experts find the best neural pipeline.
https://automl.github.io/neps/
Apache License 2.0
61 stars 13 forks source link

[SearchSpace] Allow `None`/ `bool` as a valid value in Categorical/Constant #124

Open eddiebergman opened 4 months ago

eddiebergman commented 4 months ago

Right now, the only accepted values are Iterable[float | int | str] and the default is the same, i.e. float | int | str | None = None.

There's no real restriction for this other than it needs to be tracked down where things like the following might happen, if default... (which would also not work for 0 fyi), and replace them with if default is not NotSet where NotSet follows then Sentinal pattern (it's just NotSet = object() and you check if it was not set by doing if default is NotSet)

For example, one thing that would need to change is the following:

https://github.com/automl/neps/blob/82b48903d0896db7d84ea2810f567a29d01688c3/neps/search_spaces/search_space.py#L735-L737

EDIT: apparently I already did some of this a while back but didn't complete it nor test it...

https://github.com/automl/neps/blob/82b48903d0896db7d84ea2810f567a29d01688c3/neps/search_spaces/search_space.py#L795-L798