在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:AutoDL开源软件地址:https://gitee.com/paddlepaddle/AutoDL开源软件介绍:Introduction to AutoDL DesignContentInstallationRunning 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. pip install parl pip install absl-py IntroductionAutoDL 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
tar zxf cifar-10-python.tar.gzpython dataset_maker.py Model TrainingIn 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.Here we provide the following test on the method. Test on the convergence of the number of tokens producedDue 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, 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 CNNTrain 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 Expected results:In the log, 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...... ResultsThe 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. |
请发表评论