*Tuner receive result from Trial as a matric to evaluate the performance of a specific parameters/architecture configure. And tuner send next hyper-parameter or architecture configure to Trial.*
So, if user want to implement a customized Tuner, she/he only need to:
parameters: object created by 'generate_parameters()'
reward: object reported by trial
'''
# your code implements here.
...
defgenerate_parameters(self,parameter_id):
'''
Returns a set of trial (hyper-)parameters, as a serializable object
parameter_id: int
'''
# your code implements here.
...
```
**4) Write a script to run Tuner**
```python
importargparse
importCustomizedTuner
defmain():
parser=argparse.ArgumentParser(description='parse command line parameters.')
# parse your tuner arg here.
...
FLAGS,unparsed=parser.parse_known_args()
tuner=CustomizedTuner(...)
tuner.run()
main()
```
Please noted in **2)** and **3)**. The parameter configures from ```generate_parameters``` function, will be package as json object by nni SDK. And nni SDK will unpack json object so the Trial will receive the exact same configure from Tuner.
User could override the ```run``` function in ```CustomizedTuner``` class, which could help user to control the process logic in Tuner, such as control handle request from Trial.
```receive_trial_result``` will receive ```the parameter_id, parameters, reward``` as parameters input. Also, Tuner will receive the ```reward``` object are exactly same reward that Trial send.