自動機械学習フレームワークnniのケース使用

nniは、Microsoftがオープンソース化した自動機械学習フレームワークです。

機械学習のチューニングをより便利にすることができます

インストールは非常に簡単で、pipを使用するだけです

pip install nni

今回は最新バージョンの2.0を使用しています

ただし、次のように表示されるため、現時点では使用できません。

https://github.com/microsoft/nni/issues/3276

解決策も非常に簡単で、ruamel.yamlをruamel_yamlに直接変更します

以下のパスでコンテンツを編集および変更します

vim /opt/AN/lib/python3.7/site-packages/nni/tools/nnictl/common_utils.py
vim /opt/AN/lib/python3.7/site-packages/nni/experiment/config/base.py
vim /opt/AN/lib/python3.7/site-packages/nni/tools/package_utils/__init__.py

そうすれば普通に使えます

root@lizong:/opt# nnictl --help
usage: nnictl [-h] [--version]
              {ss_gen,create,resume,view,update,stop,trial,experiment,platform,webui,config,log,algo,package,tensorboard,top}
              ...

use nnictl command to control nni experiments

positional arguments:
  {ss_gen,create,resume,view,update,stop,trial,experiment,platform,webui,config,log,algo,package,tensorboard,top}
    ss_gen              automatically generate search space file from trial
                        code
    create              create a new experiment
    resume              resume a new experiment
    view                view a stopped experiment
    update              update the experiment
    stop                stop the experiment
    trial               get trial information
    experiment          get experiment information
    platform            get platform information
    webui               get web ui information
    config              get config information
    log                 get log information
    algo                control nni builtin tuner, assessor and advisor
                        algorithms
    package             this argument is replaced by algo
    tensorboard         manage tensorboard
    top                 monitor the experiment

optional arguments:
  -h, --help            show this help message and exit
  --version, -v

次に、公式の例を実行します。

nnictl create --config nni/examples/trials/mnist-pytorch/config.yml

注:実行する前にgitcloneが必要です

git clone -b v2.0 https://github.com.cnpmjs.org/Microsoft/nni.git

正常に実行された後、Webページで実行結果を確認できます。

特定のアクセスアドレス------実行中のマシンのIP:8080

 

上の写真は48分54秒実行されており、最高スコアは99ポイントであることがわかります。

 ハイパーパラメータ曲線を見てください。

操作の概要が表示されます:

 

おすすめ

転載: blog.csdn.net/zhou_438/article/details/113872545