Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
c1e926b9
Unverified
Commit
c1e926b9
authored
Dec 12, 2020
by
J-shang
Committed by
GitHub
Dec 12, 2020
Browse files
fix generate parameter format (#3175)
parent
0d3f13a3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
4 deletions
+5
-4
docs/archive_en_US/Tutorial/SearchSpaceSpec.md
docs/archive_en_US/Tutorial/SearchSpaceSpec.md
+1
-1
docs/en_US/Tutorial/SearchSpaceSpec.rst
docs/en_US/Tutorial/SearchSpaceSpec.rst
+1
-1
nni/algorithms/hpo/gridsearch_tuner/gridsearch_tuner.py
nni/algorithms/hpo/gridsearch_tuner/gridsearch_tuner.py
+2
-2
nni/utils.py
nni/utils.py
+1
-0
No files found.
docs/archive_en_US/Tutorial/SearchSpaceSpec.md
View file @
c1e926b9
...
@@ -89,4 +89,4 @@ Known Limitations:
...
@@ -89,4 +89,4 @@ Known Limitations:
*
Note that for nested search space:
*
Note that for nested search space:
* Only Random Search/TPE/Anneal/Evolution tuner supports nested search space
* Only Random Search/TPE/Anneal/Evolution
/Grid Search
tuner supports nested search space
docs/en_US/Tutorial/SearchSpaceSpec.rst
View file @
c1e926b9
...
@@ -255,4 +255,4 @@ Known Limitations:
...
@@ -255,4 +255,4 @@ Known Limitations:
Note that for nested search space:
Note that for nested search space:
* Only Random Search/TPE/Anneal/Evolution tuner supports nested search space
* Only Random Search/TPE/Anneal/Evolution
/Grid Search
tuner supports nested search space
nni/algorithms/hpo/gridsearch_tuner/gridsearch_tuner.py
View file @
c1e926b9
...
@@ -169,7 +169,7 @@ class GridSearchTuner(Tuner):
...
@@ -169,7 +169,7 @@ class GridSearchTuner(Tuner):
"""
"""
self
.
count
+=
1
self
.
count
+=
1
while
self
.
count
<=
len
(
self
.
expanded_search_space
)
-
1
:
while
self
.
count
<=
len
(
self
.
expanded_search_space
)
-
1
:
_params_tuple
=
convert_dict2tuple
(
self
.
expanded_search_space
[
self
.
count
])
_params_tuple
=
convert_dict2tuple
(
copy
.
deepcopy
(
self
.
expanded_search_space
[
self
.
count
])
)
if
_params_tuple
in
self
.
supplement_data
:
if
_params_tuple
in
self
.
supplement_data
:
self
.
count
+=
1
self
.
count
+=
1
else
:
else
:
...
@@ -203,6 +203,6 @@ class GridSearchTuner(Tuner):
...
@@ -203,6 +203,6 @@ class GridSearchTuner(Tuner):
if
not
_value
:
if
not
_value
:
logger
.
info
(
"Useless trial data, value is %s, skip this trial data."
,
_value
)
logger
.
info
(
"Useless trial data, value is %s, skip this trial data."
,
_value
)
continue
continue
_params_tuple
=
convert_dict2tuple
(
_params
)
_params_tuple
=
convert_dict2tuple
(
copy
.
deepcopy
(
_params
)
)
self
.
supplement_data
[
_params_tuple
]
=
True
self
.
supplement_data
[
_params_tuple
]
=
True
logger
.
info
(
"Successfully import data to grid search tuner."
)
logger
.
info
(
"Successfully import data to grid search tuner."
)
nni/utils.py
View file @
c1e926b9
...
@@ -109,6 +109,7 @@ def extract_scalar_history(trial_history, scalar_key='default'):
...
@@ -109,6 +109,7 @@ def extract_scalar_history(trial_history, scalar_key='default'):
def
convert_dict2tuple
(
value
):
def
convert_dict2tuple
(
value
):
"""
"""
convert dict type to tuple to solve unhashable problem.
convert dict type to tuple to solve unhashable problem.
NOTE: this function will change original data.
"""
"""
if
isinstance
(
value
,
dict
):
if
isinstance
(
value
,
dict
):
for
_keys
in
value
:
for
_keys
in
value
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment