Unverified Commit c9720e95 authored by chicm-ms's avatar chicm-ms Committed by GitHub
Browse files

Refactor integration tests (#2190)

parent d5e6af27
{
"intermediate_result": [
{"default": 0.1, "loss": 0.11, "other": 0.111},
{"default": 0.2, "loss": 0.22, "other": 0.222},
{"default": 0.3, "loss": 0.33, "other": 0.333},
{"default": 0.4, "loss": 0.44, "other": 0.444},
{"default": 0.5, "loss": 0.55, "other": 0.555}
],
"final_result": {"default": 0.6, "loss": 0.66, "other": 0.666}
}
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import time
import json
import argparse
import nni
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--dict_metrics", action='store_true')
args = parser.parse_args()
if args.dict_metrics:
result_file = 'expected_metrics_dict.json'
else:
result_file = 'expected_metrics.json'
nni.get_next_parameter()
with open(result_file, 'r') as f:
m = json.load(f)
for v in m['intermediate_result']:
time.sleep(1)
print('report_intermediate_result:', v)
nni.report_intermediate_result(v)
time.sleep(1)
print('report_final_result:', m['final_result'])
nni.report_final_result(m['final_result'])
print('done')
authorName: nni
experimentName: default_test
maxExecDuration: 5m
maxTrialNum: 8
maxTrialNum: 4
trialConcurrency: 4
searchSpacePath: ./search_space.json
......
authorName: nni
experimentName: default_test
maxExecDuration: 5m
maxTrialNum: 8
maxTrialNum: 4
trialConcurrency: 4
searchSpacePath: ./search_space.json
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment