-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix bug in smac that configspace cannot deal with complex searchspace #716
Conversation
json.dumps(list(range(choice_len)))[1:-1], | ||
json.dumps(0))) | ||
if key in categorical_dict: | ||
raise RuntimeError('%s has already existed, please make sure no search space with the same key.' % key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change 'the same' to 'duplicate' may be more precise for this case? like:
'please make sure search space has no duplicate key'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good suggestion, thanks
search_space = nni_search_space_content | ||
with open('param_config_space.pcs', 'w') as pcs_fd: | ||
if isinstance(search_space, dict): | ||
for key in search_space.keys(): | ||
if isinstance(search_space[key], dict): | ||
try: | ||
if search_space[key]['_type'] == 'choice': | ||
choice_len = len(search_space[key]['_value']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that user's search space has no 'choice' value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it is. If there is no choice, no need to do convert for categorical in smac
in nni 0.5 and higher, mnist-annotation example cannot be tuned by SMAC tuner, because SMAC cannot parse categorical values which include ",() ". In this pr, we fixed this problem.