trial.py 541 Bytes
Newer Older
liuzhe-lz's avatar
liuzhe-lz committed
1
2
3
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

4
5
6
7
import time
import nni

if __name__ == '__main__':
8
    nni.get_next_parameter()
9
    time.sleep(1)
10
    for i in range(10):
11
12
13
14
        if i % 2 == 0:
            print('report intermediate result without end of line.', end='')
        else:
            print('report intermediate result.')
15
16
        nni.report_intermediate_result(0.1*(i+1))
        time.sleep(2)
17
    print('test final metrics not at line start.', end='')
18
    nni.report_final_result(1.0)
19
    print('done')