Unverified Commit ab640634 authored by Tab Zhang's avatar Tab Zhang Committed by GitHub
Browse files

add description about update_search_space (#2597)

parent 93d9b674
......@@ -7,7 +7,7 @@ NNI provides state-of-the-art tuning algorithm in builtin-tuners. NNI supports t
If you want to implement your own tuning algorithm, you can implement a customized Tuner, there are three things to do:
1. Inherit the base Tuner class
1. Implement receive_trial_result and generate_parameter function
1. Implement receive_trial_result, generate_parameter and update_search_space function
1. Configure your customized tuner in experiment YAML config file
Here is an example:
......@@ -22,7 +22,7 @@ class CustomizedTuner(Tuner):
...
```
**2. Implement receive_trial_result and generate_parameter function**
**2. Implement receive_trial_result, generate_parameter and update_search_space function**
```python
from nni.tuner import Tuner
......@@ -49,6 +49,16 @@ class CustomizedTuner(Tuner):
# your code implements here.
return your_parameters
...
def update_search_space(self, search_space):
'''
Tuners are advised to support updating search space at run-time.
If a tuner can only set search space once before generating first hyper-parameters,
it should explicitly document this behaviour.
search_space: JSON object created by experiment owner
'''
# your code implements here.
...
```
`receive_trial_result` will receive the `parameter_id, parameters, value` as parameters input. Also, Tuner will receive the `value` object are exactly same value that Trial send.
......
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