Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

fix bug in smac that configspace cannot deal with complex searchspace #716

Merged
merged 3 commits into from
Feb 10, 2019

Conversation

QuanluZhang
Copy link
Contributor

@QuanluZhang QuanluZhang commented Feb 8, 2019

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.

@yds05 yds05 requested a review from Crysple February 8, 2019 12:04
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)
Copy link
Contributor

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'

Copy link
Contributor Author

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'])
Copy link
Contributor

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?

Copy link
Contributor Author

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

@QuanluZhang QuanluZhang merged commit 8e732f2 into microsoft:master Feb 10, 2019
@QuanluZhang QuanluZhang deleted the fix-smac-ss branch February 20, 2020 13:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants