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
f2ddea0a
Unverified
Commit
f2ddea0a
authored
Dec 22, 2021
by
liuzhe-lz
Committed by
GitHub
Dec 22, 2021
Browse files
fix parameter converting (#4407)
parent
c837bfc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
nni/algorithms/hpo/gridsearch_tuner.py
nni/algorithms/hpo/gridsearch_tuner.py
+7
-6
No files found.
nni/algorithms/hpo/gridsearch_tuner.py
View file @
f2ddea0a
...
...
@@ -213,11 +213,12 @@ class GridSearchTuner(Tuner):
# convert self.vector to "formatted" parameters
params
=
{}
for
i
,
spec
in
enumerate
(
self
.
space
.
values
()):
x
=
self
.
grid
[
i
][
self
.
vector
[
i
]]
if
spec
.
categorical
:
params
[
spec
.
key
]
=
x
else
:
params
[
spec
.
key
]
=
_cdf_inverse
(
x
,
spec
)
if
spec
.
is_activated_in
(
params
):
x
=
self
.
grid
[
i
][
self
.
vector
[
i
]]
if
spec
.
categorical
:
params
[
spec
.
key
]
=
x
else
:
params
[
spec
.
key
]
=
_cdf_inverse
(
x
,
spec
)
return
params
def
_less
(
x
,
y
,
spec
):
...
...
@@ -247,6 +248,6 @@ def _grid_size_info(grid):
if
len
(
grid
)
==
1
:
return
str
(
len
(
grid
[
0
]))
sizes
=
[
len
(
candidates
)
for
candidates
in
grid
]
mul
=
'
x
'
.
join
(
str
(
s
)
for
s
in
sizes
)
mul
=
'
×
'
.
join
(
str
(
s
)
for
s
in
sizes
)
total
=
np
.
prod
(
sizes
)
return
f
'(
{
mul
}
) =
{
total
}
'
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