Now, you have a ``Experiment`` instance with ``tuner`` you have initialized in the previous step, and this experiment will launch trials on your local machine due to ``training_service='local'``.
Now, you have a ``Experiment`` instance, and this experiment will launch trials on your local machine due to ``training_service='local'``.
See all `training services <../training_services.rst>`__ supported in NNI.
See all `training services <../training_services.rst>`__ supported in NNI.
Use the form like ``experiment.config.foo = 'bar'`` to configure your experiment.
Use the form like ``experiment.config.foo = 'bar'`` to configure your experiment.
See all real `builtin tuners <../builtin_tuner.rst>`__ supported in NNI.
See `parameter configuration <../reference/experiment_config.rst>`__ required by different training services.
See `parameter configuration <../reference/experiment_config.rst>`__ required by different training services.
..
..
Step 3 - Just run
Step 2 - Just run
.. code-block:: python
.. code-block:: python
experiment.run(port=8081)
experiment.run(port=8080)
Now, you have successfully launched an NNI experiment. And you can type ``localhost:8081`` in your browser to observe your experiment in real time.
Now, you have successfully launched an NNI experiment. And you can type ``localhost:8080`` in your browser to observe your experiment in real time.
.. Note:: In this way, experiment will run in the foreground and will automatically exit when the experiment finished. If you want to run an experiment in an interactive way, use ``start()`` in Step 3.
.. Note:: In this way, experiment will run in the foreground and will automatically exit when the experiment finished. If you want to run an experiment in an interactive way, use ``start()`` in Step 2.
Example
Example
^^^^^^^
^^^^^^^
...
@@ -74,10 +65,8 @@ Below is an example for this new launching approach. You can also find this code
...
@@ -74,10 +65,8 @@ Below is an example for this new launching approach. You can also find this code
.. code-block:: python
.. code-block:: python
from pathlib import Path
from pathlib import Path
from nni.experiment import Experiment
from nni.algorithms.hpo.hyperopt_tuner import HyperoptTuner