Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Multiphase doc #519

Merged
merged 16 commits into from
Jan 18, 2019
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/GetStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,4 @@ The experiment has been running now, NNI provides WebUI for you to view experime
* [How to run an experiment on local (with multiple GPUs)?](tutorial_1_CR_exp_local_api.md)
* [How to run an experiment on multiple machines?](tutorial_2_RemoteMachineMode.md)
* [How to run an experiment on OpenPAI?](PAIMode.md)
* [How to create a multi-phase experiment](multiPhase.md)
31 changes: 31 additions & 0 deletions docs/multiPhase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
**Create multi-phase experiment**

Multi-phase experiments refer to experiments whose trial jobs request multiple hyper parameters from tuner and report multiple final results to NNI.
To use multi-phase experiment, the Tuner needs to be a subclass of nni.multi_phase.MultiPhaseTuner. For example, this [ENAS tuner](https://github.com/countif/enas_nni/blob/master/nni/examples/tuners/enas/src/nni_controller.py) is a multi-phase Tuner.
```multiPhase``` field needs to be set to ```true``` in configuration file, for example:

```yml
...
multiPhase: true
tuner:
codeDir: tuners/enas
classFileName: nni_controller_ptb.py
className: ENASTuner
classArgs:
say_hello: "hello"
...
```


Then, nni.get_next_parameter() API can be invoked for multiple times in a trial, for example:

```python
for i in range(5):
# get parameters form tuner
hyper_params = nni.get_next_parameter()

# consume the params
# ...
```

API ```nni.report_final_result()``` can be called one time for each hyper parameters.