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
d750246c
"...composable_kernel_rocm.git" did not exist on "7857f6217574e4d4571f0a9b89fc862e75f78fa4"
Unverified
Commit
d750246c
authored
Sep 27, 2018
by
QuanluZhang
Committed by
GitHub
Sep 27, 2018
Browse files
fix convert from ss to pcs (#133)
parent
9cc9c68a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
src/sdk/pynni/nni/smac_tuner/convert_ss_to_scenario.py
src/sdk/pynni/nni/smac_tuner/convert_ss_to_scenario.py
+8
-8
No files found.
src/sdk/pynni/nni/smac_tuner/convert_ss_to_scenario.py
View file @
d750246c
...
...
@@ -49,8 +49,8 @@ def generate_pcs(nni_search_space_content):
if
search_space
[
key
][
'_type'
]
==
'choice'
:
pcs_fd
.
write
(
'%s categorical {%s} [%s]
\n
'
%
(
key
,
str
(
search_space
[
key
][
'_value'
])[
1
:
-
1
],
search_space
[
key
][
'_value'
][
0
]))
json
.
dumps
(
search_space
[
key
][
'_value'
])[
1
:
-
1
],
json
.
dumps
(
search_space
[
key
][
'_value'
][
0
]))
)
elif
search_space
[
key
][
'_type'
]
==
'randint'
:
# TODO: support lower bound in randint
pcs_fd
.
write
(
'%s integer [0, %d] [%d]
\n
'
%
(
...
...
@@ -58,15 +58,15 @@ def generate_pcs(nni_search_space_content):
search_space
[
key
][
'_value'
][
0
],
search_space
[
key
][
'_value'
][
0
]))
elif
search_space
[
key
][
'_type'
]
==
'uniform'
:
pcs_fd
.
write
(
'%s real %s [%
f
]
\n
'
%
(
pcs_fd
.
write
(
'%s real %s [%
s
]
\n
'
%
(
key
,
search_space
[
key
][
'_value'
],
search_space
[
key
][
'_value'
][
0
]))
json
.
dumps
(
search_space
[
key
][
'_value'
]
)
,
json
.
dumps
(
search_space
[
key
][
'_value'
][
0
]))
)
elif
search_space
[
key
][
'_type'
]
==
'loguniform'
:
pcs_fd
.
write
(
'%s real %s [%
f
] log
\n
'
%
(
pcs_fd
.
write
(
'%s real %s [%
s
] log
\n
'
%
(
key
,
search_space
[
key
][
'_value'
],
search_space
[
key
][
'_value'
][
0
]))
json
.
dumps
(
search_space
[
key
][
'_value'
]
)
,
json
.
dumps
(
search_space
[
key
][
'_value'
][
0
]))
)
elif
search_space
[
key
][
'_type'
]
==
'quniform'
\
and
search_space
[
key
][
'_value'
][
2
]
==
1
:
pcs_fd
.
write
(
'%s integer [%d, %d] [%d]
\n
'
%
(
...
...
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