Commit 962d9aee authored by liuzhe-lz's avatar liuzhe-lz Committed by chicm-ms
Browse files

Update MNIST example path in docs (#1805)

* Update MNIST example path in docs

* revert chinese doc
parent 1b1ec1f9
...@@ -44,7 +44,7 @@ maxExecDuration: 10h ...@@ -44,7 +44,7 @@ maxExecDuration: 10h
maxTrialNum: 100 maxTrialNum: 100
#choice: local, remote, pai, kubeflow, frameworkcontroller #choice: local, remote, pai, kubeflow, frameworkcontroller
trainingServicePlatform: frameworkcontroller trainingServicePlatform: frameworkcontroller
searchSpacePath: ~/nni/examples/trials/mnist/search_space.json searchSpacePath: ~/nni/examples/trials/mnist-tfv1/search_space.json
#choice: true, false #choice: true, false
useAnnotation: false useAnnotation: false
tuner: tuner:
...@@ -59,7 +59,7 @@ assessor: ...@@ -59,7 +59,7 @@ assessor:
optimize_mode: maximize optimize_mode: maximize
gpuNum: 0 gpuNum: 0
trial: trial:
codeDir: ~/nni/examples/trials/mnist codeDir: ~/nni/examples/trials/mnist-tfv1
taskRoles: taskRoles:
- name: worker - name: worker
taskNum: 1 taskNum: 1
......
...@@ -84,7 +84,7 @@ kubeflowConfig: ...@@ -84,7 +84,7 @@ kubeflowConfig:
## Run an experiment ## Run an experiment
Use `examples/trials/mnist` as an example. This is a tensorflow job, and use tf-operator of Kubeflow. The NNI config YAML file's content is like: Use `examples/trials/mnist-tfv1` as an example. This is a tensorflow job, and use tf-operator of Kubeflow. The NNI config YAML file's content is like:
```yaml ```yaml
authorName: default authorName: default
......
**Tutorial: Create and Run an Experiment on local with NNI API** **Tutorial: Create and Run an Experiment on local with NNI API**
=== ===
In this tutorial, we will use the example in [~/examples/trials/mnist] to explain how to create and run an experiment on local with NNI API. In this tutorial, we will use the example in [~/examples/trials/mnist-tfv1] to explain how to create and run an experiment on local with NNI API.
>Before starts >Before starts
......
...@@ -51,4 +51,4 @@ Our documentation is built with [sphinx](http://sphinx-doc.org/), supporting [Ma ...@@ -51,4 +51,4 @@ Our documentation is built with [sphinx](http://sphinx-doc.org/), supporting [Ma
* For links, please consider using __relative paths__ first. However, if the documentation is written in Markdown format, and: * For links, please consider using __relative paths__ first. However, if the documentation is written in Markdown format, and:
* It's an image link which needs to be formatted with embedded html grammar, please use global URL like `https://user-images.githubusercontent.com/44491713/51381727-e3d0f780-1b4f-11e9-96ab-d26b9198ba65.png`, which can be automatically generated by dragging picture onto [Github Issue](https://github.com/Microsoft/nni/issues/new) Box. * It's an image link which needs to be formatted with embedded html grammar, please use global URL like `https://user-images.githubusercontent.com/44491713/51381727-e3d0f780-1b4f-11e9-96ab-d26b9198ba65.png`, which can be automatically generated by dragging picture onto [Github Issue](https://github.com/Microsoft/nni/issues/new) Box.
* It cannot be re-formatted by sphinx, such as source code, please use its global URL. For source code that links to our github repo, please use URLs rooted at `https://github.com/Microsoft/nni/tree/master/` ([mnist.py](https://github.com/Microsoft/nni/blob/master/examples/trials/mnist/mnist.py) for example). * It cannot be re-formatted by sphinx, such as source code, please use its global URL. For source code that links to our github repo, please use URLs rooted at `https://github.com/Microsoft/nni/tree/master/` ([mnist.py](https://github.com/Microsoft/nni/blob/master/examples/trials/mnist-tfv1/mnist.py) for example).
...@@ -9,7 +9,7 @@ Currently we support local, remote and pai mode on Windows. Windows 10.1809 is w ...@@ -9,7 +9,7 @@ Currently we support local, remote and pai mode on Windows. Windows 10.1809 is w
When these things are done, use the **config_windows.yml** configuration to start an experiment for validation. When these things are done, use the **config_windows.yml** configuration to start an experiment for validation.
```bash ```bash
nnictl create --config nni\examples\trials\mnist\config_windows.yml nnictl create --config nni\examples\trials\mnist-tfv1\config_windows.yml
``` ```
For other examples you need to change trial command `python3` into `python` in each example YAML. For other examples you need to change trial command `python3` into `python` in each example YAML.
......
...@@ -55,19 +55,19 @@ nnictl support commands: ...@@ -55,19 +55,19 @@ nnictl support commands:
> create a new experiment with the default port: 8080 > create a new experiment with the default port: 8080
```bash ```bash
nnictl create --config nni/examples/trials/mnist/config.yml nnictl create --config nni/examples/trials/mnist-tfv1/config.yml
``` ```
> create a new experiment with specified port 8088 > create a new experiment with specified port 8088
```bash ```bash
nnictl create --config nni/examples/trials/mnist/config.yml --port 8088 nnictl create --config nni/examples/trials/mnist-tfv1/config.yml --port 8088
``` ```
> create a new experiment with specified port 8088 and debug mode > create a new experiment with specified port 8088 and debug mode
```bash ```bash
nnictl create --config nni/examples/trials/mnist/config.yml --port 8088 --debug nnictl create --config nni/examples/trials/mnist-tfv1/config.yml --port 8088 --debug
``` ```
Note: Note:
...@@ -210,10 +210,10 @@ Debug mode will disable version check function in Trialkeeper. ...@@ -210,10 +210,10 @@ Debug mode will disable version check function in Trialkeeper.
* Example * Example
`update experiment's new search space with file dir 'examples/trials/mnist/search_space.json'` `update experiment's new search space with file dir 'examples/trials/mnist-tfv1/search_space.json'`
```bash ```bash
nnictl update searchspace [experiment_id] --filename examples/trials/mnist/search_space.json nnictl update searchspace [experiment_id] --filename examples/trials/mnist-tfv1/search_space.json
``` ```
* __nnictl update concurrency__ * __nnictl update concurrency__
......
...@@ -47,7 +47,7 @@ if __name__ == '__main__': ...@@ -47,7 +47,7 @@ if __name__ == '__main__':
run_trial(params) run_trial(params)
``` ```
Note: If you want to see the full implementation, please refer to [examples/trials/mnist/mnist_before.py](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist/mnist_before.py) Note: If you want to see the full implementation, please refer to [examples/trials/mnist-tfv1/mnist_before.py](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist-tfv1/mnist_before.py)
The above code can only try one set of parameters at a time, if we want to tune learning rate, we need to manually modify the hyperparameter and start the trial again and again. The above code can only try one set of parameters at a time, if we want to tune learning rate, we need to manually modify the hyperparameter and start the trial again and again.
...@@ -84,7 +84,7 @@ If you want to use NNI to automatically train your model and find the optimal hy ...@@ -84,7 +84,7 @@ If you want to use NNI to automatically train your model and find the optimal hy
+ } + }
``` ```
*Implemented code directory: [search_space.json](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist/search_space.json)* *Implemented code directory: [search_space.json](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist-tfv1/search_space.json)*
**Step 2**: Modified your `Trial` file to get the hyperparameter set from NNI and report the final result to NNI. **Step 2**: Modified your `Trial` file to get the hyperparameter set from NNI and report the final result to NNI.
...@@ -109,7 +109,7 @@ If you want to use NNI to automatically train your model and find the optimal hy ...@@ -109,7 +109,7 @@ If you want to use NNI to automatically train your model and find the optimal hy
run_trial(params) run_trial(params)
``` ```
*Implemented code directory: [mnist.py](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist/mnist.py)* *Implemented code directory: [mnist.py](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist-tfv1/mnist.py)*
**Step 3**: Define a `config` file in YAML, which declare the `path` to search space and trial, also give `other information` such as tuning algorithm, max trial number and max duration arguments. **Step 3**: Define a `config` file in YAML, which declare the `path` to search space and trial, also give `other information` such as tuning algorithm, max trial number and max duration arguments.
...@@ -134,15 +134,15 @@ trial: ...@@ -134,15 +134,15 @@ trial:
Note, **for Windows, you need to change trial command `python3` to `python`** Note, **for Windows, you need to change trial command `python3` to `python`**
*Implemented code directory: [config.yml](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist/config.yml)* *Implemented code directory: [config.yml](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist-tfv1/config.yml)*
All the codes above are already prepared and stored in [examples/trials/mnist/](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist). All the codes above are already prepared and stored in [examples/trials/mnist-tfv1/](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist-tfv1).
#### Linux and MacOS #### Linux and MacOS
Run the **config.yml** file from your command line to start MNIST experiment. Run the **config.yml** file from your command line to start MNIST experiment.
```bash ```bash
nnictl create --config nni/examples/trials/mnist/config.yml nnictl create --config nni/examples/trials/mnist-tfv1/config.yml
``` ```
#### Windows #### Windows
Run the **config_windows.yml** file from your command line to start MNIST experiment. Run the **config_windows.yml** file from your command line to start MNIST experiment.
...@@ -150,7 +150,7 @@ Run the **config_windows.yml** file from your command line to start MNIST experi ...@@ -150,7 +150,7 @@ Run the **config_windows.yml** file from your command line to start MNIST experi
**Note**, if you're using NNI on Windows, it needs to change `python3` to `python` in the config.yml file, or use the config_windows.yml file to start the experiment. **Note**, if you're using NNI on Windows, it needs to change `python3` to `python` in the config.yml file, or use the config_windows.yml file to start the experiment.
```bash ```bash
nnictl create --config nni\examples\trials\mnist\config_windows.yml nnictl create --config nni\examples\trials\mnist-tfv1\config_windows.yml
``` ```
Note, **nnictl** is a command line tool, which can be used to control experiments, such as start/stop/resume an experiment, start/stop NNIBoard, etc. Click [here](Nnictl.md) for more usage of `nnictl` Note, **nnictl** is a command line tool, which can be used to control experiments, such as start/stop/resume an experiment, start/stop NNIBoard, etc. Click [here](Nnictl.md) for more usage of `nnictl`
......
...@@ -52,7 +52,7 @@ Now, you can try to start an experiment to check if your environment is ready. ...@@ -52,7 +52,7 @@ Now, you can try to start an experiment to check if your environment is ready.
For example, run the command For example, run the command
``` ```
nnictl create --config ~/nni/examples/trials/mnist/config.yml nnictl create --config ~/nni/examples/trials/mnist-tfv1/config.yml
``` ```
And open WebUI to check if everything is OK And open WebUI to check if everything is OK
......
...@@ -6,7 +6,7 @@ Assessor receives the intermediate result from Trial and decides whether the Tri ...@@ -6,7 +6,7 @@ Assessor receives the intermediate result from Trial and decides whether the Tri
Here is an experimental result of MNIST after using 'Curvefitting' Assessor in 'maximize' mode, you can see that assessor successfully **early stopped** many trials with bad hyperparameters in advance. If you use assessor, we may get better hyperparameters under the same computing resources. Here is an experimental result of MNIST after using 'Curvefitting' Assessor in 'maximize' mode, you can see that assessor successfully **early stopped** many trials with bad hyperparameters in advance. If you use assessor, we may get better hyperparameters under the same computing resources.
*Implemented code directory: config_assessor.yml <https://github.com/Microsoft/nni/blob/master/examples/trials/mnist/config_assessor.yml>* *Implemented code directory: config_assessor.yml <https://github.com/Microsoft/nni/blob/master/examples/trials/mnist-tfv1/config_assessor.yml>*
.. image:: ../img/Assessor.png .. image:: ../img/Assessor.png
......
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