项目介绍

alphadl/darts.pytorch1.1 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,目前获得 83 个 Star、28 次 Fork。

仓库全名
alphadl/darts.pytorch1.1
Star 数
83
Fork 数
28
未关闭 Issue
4

README 摘要

darts.pytorch1.1 Implementation with latest PyTorch for multi-gpu DARTS https://arxiv.org/abs/1806.09055 🚩 Note that this is not the official code, please refer https://github.com/quark0/darts for more details. Differentiable Architecture Search Code accompanying the paper DARTS: Differentiable Architecture Search\ Hanxiao Liu, Karen Simonyan, Yiming Yang.\ arXiv:1806.09055. The algorithm is based on continuous…

完整内容见 GitHub 原始 README 或本页 。

常见问题

darts.pytorch1.1 用什么语言开发?

主要使用 Python 编写,目前有 83 个 Star。

如何获取 darts.pytorch1.1 的源码?

可以直接克隆仓库:git clone https://github.com/alphadl/darts.pytorch1.1.git,默认分支为 master;安装与运行步骤见仓库 README。

darts.pytorch1.1 最近还在维护吗?

仓库最近一次更新为 1月31日,当前有 4 个未关闭 Issue;Star 数为 83,可作为社区活跃度的参考。

关于

Implementation with latest PyTorch (v1.1) for multi-gpu differentiable architecture search https://arxiv.org/abs/1806.09055

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
142
价值分
58
活跃状态
活跃

README

darts.pytorch1.1

Stars Forks

Implementation with latest PyTorch for multi-gpu DARTS https://arxiv.org/abs/1806.09055

🚩 Note that this is not the official code, please refer https://github.com/quark0/darts for more details.

Code accompanying the paper

DARTS: Differentiable Architecture Search
Hanxiao Liu, Karen Simonyan, Yiming Yang.
arXiv:1806.09055.

darts

The algorithm is based on continuous relaxation and gradient descent in the architecture space. It is able to efficiently design high-performance convolutional architectures for image classification (on CIFAR-10 and ImageNet) and recurrent architectures for language modeling (on Penn Treebank and WikiText-2). Only a single GPU is required.

Requirements

Python >= 3.5.5, PyTorch == 1.1

NOTE: The latest PyTorch 1.1 is supported at this version.

Datasets

Instructions for acquiring PTB and WT2 can be found here. While CIFAR-10 can be automatically downloaded by torchvision.

Pretrained models

The easist way to get started is to evaluate our pretrained DARTS models.

CIFAR-10 (cifar10_model.pt)

cd cnn && python test.py --auxiliary --model_path cifar10_model.pt
  • Expected result: 2.63% test error rate with 3.3M model params.

PTB (ptb_model.pt)

cd rnn && python test.py --model_path ptb_model.pt
  • Expected result: 55.68 test perplexity with 23M model params.

Architecture search (using small proxy models)

To carry out architecture search using 2nd-order approximation, run

cd cnn && python train_search.py --gpu 0,1    # for conv cells on CIFAR-10
cd rnn && python train_search.py --gpu 0,1    # for recurrent cells on PTB

Recent change: CNN search and evaluation now support multi-GPU data parallelism (e.g. --gpu 0,1,2,3); RNN remains single-GPU.

Note the validation performance in this step does not indicate the final performance of the architecture. One must train the obtained genotype/architecture from scratch using full-sized models, as described in the next section.

Also be aware that different runs would end up with different local minimum. To get the best result, it is crucial to repeat the search process with different seeds and select the best cell(s) based on validation performance (obtained by training the derived cell from scratch for a small number of epochs). Please refer to fig. 3 and sect. 3.2 in our arXiv paper.

progress_convolutional_normal progress_convolutional_reduce progress_recurrent

Figure: Snapshots of the most likely normal conv, reduction conv, and recurrent cells over time.

Architecture evaluation (using full-sized models)

To evaluate our best cells by training from scratch, run

cd cnn && python train.py --auxiliary --cutout            # CIFAR-10
cd rnn && python train.py                                 # PTB

Customized architectures are supported through the --arch flag once specified in genotypes.py.

The CIFAR-10 result at the end of training is subject to variance due to the non-determinism of cuDNN back-prop kernels. It would be misleading to report the result of only a single run. By training our best cell from scratch, one should expect the average test error of 10 independent runs to fall in the range of 2.76 +/- 0.09% with high probability.

cifar10 ptb ptb

Figure: Expected learning curves on CIFAR-10 (4 runs), ImageNet and PTB.

Visualization

Package graphviz is required to visualize the learned cells

python visualize.py DARTS

where DARTS can be replaced by any customized architectures in genotypes.py.

Citation

If you use any part of this code in your research, please cite our paper:

@article{liu2018darts,
  title={DARTS: Differentiable Architecture Search},
  author={Liu, Hanxiao and Simonyan, Karen and Yang, Yiming},
  journal={arXiv preprint arXiv:1806.09055},
  year={2018}
}

评论

暂无评论