• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

AutoDL: AutoDL is an efficient automated neural architecture design method. It d ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

AutoDL

开源软件地址:

https://gitee.com/paddlepaddle/AutoDL

开源软件介绍:

Introduction to AutoDL Design

Content

Installation

Running demo code in the current directory requires PadddlePaddle Fluid v.1.3.0 or above. If your runtime environment does not meet this requirement, please update PaddlePaddle according to the documents.

  • Install Python2.7
  • Install dependencies PARL framework and absl-py library,as follows:
	pip install parl	pip install absl-py

Introduction

AutoDL is an efficient automated neural architecture design method. It designs quality customized neural architecture via reinforcement learning. The system consists of two components: an encoder of the neural architecture, and a critic of the model performance. The encoder encodes neural architecture using a recurrent neural network, and the critic evaluates the sampled architecture in terms of accuracy, number of model parameters, etc., which are fed back to the encoder. The encoder updates its parameters accordingly, and samples a new batch of architectures. After several iterations, the encoder is trained to converge and finds a quality architecture. The open-sourced AutoDl Design is one implementation of AutoDL technique. Section 2 presents the usage of AutoDL. Section 3 presents the framework and examples.

Data Preparation

  • Clone PaddlePaddle/AutoDL to local machine,and enter the path of AutoDL Design.
  • Download CIFAR-10 training data, unzip to AutoDL Design/cifar, and generate a dataset of 10 classes and 100 images per class using dataset_maker.py
tar zxf cifar-10-python.tar.gzpython dataset_maker.py

Model Training

In the training process, AutoDLa Design agent generates tokens and adjacency matrices used for training, and the trainer uses these tokens and matrices to construct and train convolutional neural networks. The validation accuracy after 20 epochs are used as feed back for the agent, and the agent updates its policy accordingly. After several iterations, the agent learns to find a quality deep neural network.PictureHere we provide the following test on the method.

Test on the convergence of the number of tokens produced

Due to the long training time of CNN, to test the validity of agent framework, we use the number of "correct" tokens produced as a pseudo reward. The agent will learn to produce more "correct" tokens per step. The total length of tokens is set at 20.

	export FLAGS_fraction_of_gpu_memory_to_use=0.98	export FLAGS_eager_delete_tensor_gb=0.0	export FLAGS_fast_eager_deletion_mode=1	CUDA_VISIBLE_DEVICES=0 python -u simple_main.py

Expected results:In the log, average rewards gradually converges to 20:

Simple run target is 20mid=0, average rewards=2.500...mid=450, average rewards=17.100mid=460, average rewards=17.000

Training AutoDL to design CNN

Train AutoDL Design on the small scale dataset prepared in the previous section:

	export FLAGS_fraction_of_gpu_memory_to_use=0.98	export FLAGS_eager_delete_tensor_gb=0.0	export FLAGS_fast_eager_deletion_mode=1	CUDA_VISIBLE_DEVICES=0 python -u main.py

Note: It requires two GPUs for training, GPU used by the Agent is set by CUDA_VISIBLE_DEVICES=0(in main.py);Trainer uses GPU set by CUDA_VISIBLE_DEVICES=1(in autodl.py)

Expected results:In the log, average accuracy gradually increases:

step = 0, average accuracy = 0.633step = 1, average accuracy = 0.688step = 2, average accuracy = 0.626step = 3, average accuracy = 0.682......step = 842, average accuracy = 0.823step = 843, average accuracy = 0.825step = 844, average accuracy = 0.808......

Results

PictureThe x-axis is the number of steps, and the y-axis is validation accuracy of the sampled models. The average performance of the sampled models improves over time.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap