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
3b60f115
Unverified
Commit
3b60f115
authored
Aug 12, 2019
by
Guoxin
Committed by
GitHub
Aug 12, 2019
Browse files
Metis ss (#1438)
* use same pattern of quniform/randint as other tuners
parent
485245a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
src/sdk/pynni/nni/metis_tuner/lib_data.py
src/sdk/pynni/nni/metis_tuner/lib_data.py
+1
-1
src/sdk/pynni/nni/metis_tuner/metis_tuner.py
src/sdk/pynni/nni/metis_tuner/metis_tuner.py
+4
-5
No files found.
src/sdk/pynni/nni/metis_tuner/lib_data.py
View file @
3b60f115
...
@@ -55,7 +55,7 @@ def rand(x_bounds, x_types):
...
@@ -55,7 +55,7 @@ def rand(x_bounds, x_types):
temp
=
x_bounds
[
i
][
random
.
randint
(
0
,
len
(
x_bounds
[
i
])
-
1
)]
temp
=
x_bounds
[
i
][
random
.
randint
(
0
,
len
(
x_bounds
[
i
])
-
1
)]
outputs
.
append
(
temp
)
outputs
.
append
(
temp
)
elif
x_types
[
i
]
==
"range_int"
:
elif
x_types
[
i
]
==
"range_int"
:
temp
=
random
.
randint
(
x_bounds
[
i
][
0
],
x_bounds
[
i
][
1
])
temp
=
random
.
randint
(
x_bounds
[
i
][
0
],
x_bounds
[
i
][
1
]
-
1
)
outputs
.
append
(
temp
)
outputs
.
append
(
temp
)
elif
x_types
[
i
]
==
"range_continuous"
:
elif
x_types
[
i
]
==
"range_continuous"
:
temp
=
random
.
uniform
(
x_bounds
[
i
][
0
],
x_bounds
[
i
][
1
])
temp
=
random
.
uniform
(
x_bounds
[
i
][
0
],
x_bounds
[
i
][
1
])
...
...
src/sdk/pynni/nni/metis_tuner/metis_tuner.py
View file @
3b60f115
...
@@ -121,13 +121,12 @@ class MetisTuner(Tuner):
...
@@ -121,13 +121,12 @@ class MetisTuner(Tuner):
key_range
=
search_space
[
key
][
'_value'
]
key_range
=
search_space
[
key
][
'_value'
]
idx
=
self
.
key_order
.
index
(
key
)
idx
=
self
.
key_order
.
index
(
key
)
if
key_type
==
'quniform'
:
if
key_type
==
'quniform'
:
if
key_range
[
2
]
==
1
:
if
key_range
[
2
]
==
1
and
key_range
[
0
].
is_integer
()
and
key_range
[
1
].
is_integer
()
:
self
.
x_bounds
[
idx
]
=
[
key_range
[
0
],
key_range
[
1
]]
self
.
x_bounds
[
idx
]
=
[
key_range
[
0
],
key_range
[
1
]
+
1
]
self
.
x_types
[
idx
]
=
'range_int'
self
.
x_types
[
idx
]
=
'range_int'
else
:
else
:
bounds
=
[]
low
,
high
,
q
=
key_range
for
value
in
np
.
arange
(
key_range
[
0
],
key_range
[
1
],
key_range
[
2
]):
bounds
=
np
.
clip
(
np
.
arange
(
np
.
round
(
low
/
q
),
np
.
round
(
high
/
q
)
+
1
)
*
q
,
low
,
high
)
bounds
.
append
(
value
)
self
.
x_bounds
[
idx
]
=
bounds
self
.
x_bounds
[
idx
]
=
bounds
self
.
x_types
[
idx
]
=
'discrete_int'
self
.
x_types
[
idx
]
=
'discrete_int'
elif
key_type
==
'randint'
:
elif
key_type
==
'randint'
:
...
...
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