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
642967b8
Commit
642967b8
authored
Apr 22, 2019
by
Shufan Huang
Committed by
QuanluZhang
Apr 22, 2019
Browse files
Fix bug in import data feature (#1003)
fix bug in import data function
parent
32744774
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
12 deletions
+19
-12
docs/en_US/NNICTLDOC.md
docs/en_US/NNICTLDOC.md
+4
-4
src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py
src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py
+12
-5
src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py
src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py
+1
-1
src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py
src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py
+1
-1
src/sdk/pynni/nni/metis_tuner/metis_tuner.py
src/sdk/pynni/nni/metis_tuner/metis_tuner.py
+1
-1
No files found.
docs/en_US/NNICTLDOC.md
View file @
642967b8
...
@@ -167,7 +167,7 @@ Debug mode will disable version check function in Trialkeeper.
...
@@ -167,7 +167,7 @@ Debug mode will disable version check function in Trialkeeper.
`update experiment's new search space with file dir 'examples/trials/mnist/search_space.json'`
`update experiment's new search space with file dir 'examples/trials/mnist/search_space.json'`
```bash
```bash
nnictl update searchspace [experiment_id] --file examples/trials/mnist/search_space.json
nnictl update searchspace [experiment_id] --file
name
examples/trials/mnist/search_space.json
```
```
*
__nnictl update concurrency__
*
__nnictl update concurrency__
...
@@ -388,7 +388,7 @@ Debug mode will disable version check function in Trialkeeper.
...
@@ -388,7 +388,7 @@ Debug mode will disable version check function in Trialkeeper.
|Name, shorthand|Required|Default|Description|
|Name, shorthand|Required|Default|Description|
|------|------|------ |------|
|------|------|------ |------|
|id| False| |ID of the experiment |
|id| False| |ID of the experiment |
|--file| True| |File path of the output file |
|--file
name, -f
| True| |File path of the output file |
|--type| True| |Type of output file, only support "csv" and "json"|
|--type| True| |Type of output file, only support "csv" and "json"|
*
Examples
*
Examples
...
@@ -396,7 +396,7 @@ Debug mode will disable version check function in Trialkeeper.
...
@@ -396,7 +396,7 @@ Debug mode will disable version check function in Trialkeeper.
> export all trial data in an experiment as json format
> export all trial data in an experiment as json format
```
bash
```
bash
nnictl experiment
export
[
experiment_id]
--file
[
file_path]
--type
json
nnictl experiment
export
[
experiment_id]
--file
name
[
file_path]
--type
json
```
```
*
__nnictl experiment import__
*
__nnictl experiment import__
...
@@ -415,7 +415,7 @@ Debug mode will disable version check function in Trialkeeper.
...
@@ -415,7 +415,7 @@ Debug mode will disable version check function in Trialkeeper.
|Name, shorthand|Required|Default|Description|
|Name, shorthand|Required|Default|Description|
|------|------|------|------|
|------|------|------|------|
|id| False| |The id of the experiment you want to import data into|
|id| False| |The id of the experiment you want to import data into|
|--file, -f| True| |a file with data you want to import in json format|
|--file
name
, -f| True| |a file with data you want to import in json format|
*
Details
*
Details
...
...
src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py
View file @
642967b8
...
@@ -589,19 +589,26 @@ class BOHB(MsgDispatcherBase):
...
@@ -589,19 +589,26 @@ class BOHB(MsgDispatcherBase):
"""
"""
_completed_num
=
0
_completed_num
=
0
for
trial_info
in
data
:
for
trial_info
in
data
:
logger
.
info
(
"Importing data, current processing progress %s / %s"
%
(
_completed_num
)
,
len
(
data
))
logger
.
info
(
"Importing data, current processing progress %s / %s"
%
(
_completed_num
,
len
(
data
))
)
_completed_num
+=
1
_completed_num
+=
1
assert
"parameter"
in
trial_info
assert
"parameter"
in
trial_info
_params
=
trial_info
[
"parameter"
]
_params
=
trial_info
[
"parameter"
]
assert
"value"
in
trial_info
assert
"value"
in
trial_info
_value
=
trial_info
[
'value'
]
_value
=
trial_info
[
'value'
]
if
_KEY
not
in
_params
:
budget_exist_flag
=
False
_params
[
_KEY
]
=
self
.
max_budget
barely_params
=
dict
()
for
keys
in
_params
:
if
keys
==
_KEY
:
_budget
=
_params
[
keys
]
budget_exist_flag
=
True
else
:
barely_params
[
keys
]
=
_params
[
keys
]
if
not
budget_exist_flag
:
_budget
=
self
.
max_budget
logger
.
info
(
"Set
\"
TRIAL_BUDGET
\"
value to %s (max budget)"
%
self
.
max_budget
)
logger
.
info
(
"Set
\"
TRIAL_BUDGET
\"
value to %s (max budget)"
%
self
.
max_budget
)
if
self
.
optimize_mode
is
OptimizeMode
.
Maximize
:
if
self
.
optimize_mode
is
OptimizeMode
.
Maximize
:
reward
=
-
_value
reward
=
-
_value
else
:
else
:
reward
=
_value
reward
=
_value
_budget
=
_params
[
_KEY
]
self
.
cg
.
new_result
(
loss
=
reward
,
budget
=
_budget
,
parameters
=
barely_params
,
update_model
=
True
)
self
.
cg
.
new_result
(
loss
=
reward
,
budget
=
_budget
,
parameters
=
_params
,
update_model
=
True
)
logger
.
info
(
"Successfully import tuning data to BOHB advisor."
)
logger
.
info
(
"Successfully import tuning data to BOHB advisor."
)
src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py
View file @
642967b8
...
@@ -160,7 +160,7 @@ class GridSearchTuner(Tuner):
...
@@ -160,7 +160,7 @@ class GridSearchTuner(Tuner):
"""
"""
_completed_num
=
0
_completed_num
=
0
for
trial_info
in
data
:
for
trial_info
in
data
:
logger
.
info
(
"Importing data, current processing progress %s / %s"
%
(
_completed_num
)
,
len
(
data
))
logger
.
info
(
"Importing data, current processing progress %s / %s"
%
(
_completed_num
,
len
(
data
))
)
_completed_num
+=
1
_completed_num
+=
1
assert
"parameter"
in
trial_info
assert
"parameter"
in
trial_info
_params
=
trial_info
[
"parameter"
]
_params
=
trial_info
[
"parameter"
]
...
...
src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py
View file @
642967b8
...
@@ -365,7 +365,7 @@ class HyperoptTuner(Tuner):
...
@@ -365,7 +365,7 @@ class HyperoptTuner(Tuner):
"""
"""
_completed_num
=
0
_completed_num
=
0
for
trial_info
in
data
:
for
trial_info
in
data
:
logger
.
info
(
"Importing data, current processing progress %s / %s"
%
(
_completed_num
)
,
len
(
data
))
logger
.
info
(
"Importing data, current processing progress %s / %s"
%
(
_completed_num
,
len
(
data
))
)
_completed_num
+=
1
_completed_num
+=
1
if
self
.
algorithm_name
==
'random_search'
:
if
self
.
algorithm_name
==
'random_search'
:
return
return
...
...
src/sdk/pynni/nni/metis_tuner/metis_tuner.py
View file @
642967b8
...
@@ -411,7 +411,7 @@ class MetisTuner(Tuner):
...
@@ -411,7 +411,7 @@ class MetisTuner(Tuner):
"""
"""
_completed_num
=
0
_completed_num
=
0
for
trial_info
in
data
:
for
trial_info
in
data
:
logger
.
info
(
"Importing data, current processing progress %s / %s"
%
(
_completed_num
)
,
len
(
data
))
logger
.
info
(
"Importing data, current processing progress %s / %s"
%
(
_completed_num
,
len
(
data
))
)
_completed_num
+=
1
_completed_num
+=
1
assert
"parameter"
in
trial_info
assert
"parameter"
in
trial_info
_params
=
trial_info
[
"parameter"
]
_params
=
trial_info
[
"parameter"
]
...
...
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