You can following below steps to install a customized tuner in nni/examples/tuners/customized_tuner
as a builtin tuner.
There are 2 options to install this customized tuner:
Step 1: From nni/examples/tuners/customized_tuner
directory, run:
python setup.py develop
This command will build the nni/examples/tuners/customized_tuner
directory as a pip installation source.
Step 2: Run command:
nnictl package install ./
Step 1: From nni/examples/tuners/customized_tuner
directory, run:
python setup.py bdist_wheel
This command build a whl file which is a pip installation source.
Step 2: Run command:
nnictl package install dist/demo_tuner-0.1-py3-none-any.whl
Then run command nnictl package list
, you should be able to see that demotuner is installed:
+-----------------+------------+-----------+--------=-------------+------------------------------------------+
| Name | Type | Installed | Class Name | Module Name |
+-----------------+------------+-----------+----------------------+------------------------------------------+
| demotuner | tuners | Yes | DemoTuner | demo_tuner |
+-----------------+------------+-----------+----------------------+------------------------------------------+
Now you can use the demotuner in experiment configuration file the same way as other builtin tuners:
tuner:
builtinTunerName: demotuner
classArgs:
#choice: maximize, minimize
optimize_mode: maximize