autodl-projects/README.md

63 lines
2.6 KiB
Markdown
Raw Normal View History

## [Searching for A Robust Neural Architecture in Four GPU Hours](http://xuanyidong.com/publication/gradient-based-diff-sampler/)
2019-01-31 15:27:38 +01:00
2019-03-31 16:49:43 +02:00
We propose A Gradient-based neural architecture search approach using Differentiable Architecture Sampler (GDAS).
2019-01-31 15:27:38 +01:00
2019-04-02 11:06:25 +02:00
<img src="data/GDAS.png" width="520">
Figure-1. We utilize a DAG to represent the search space of a neural cell. Different operations (colored arrows) transform one node (square) to its intermediate features (little circles). Meanwhile, each node is the sum of the intermediate features transformed from the previous nodes. As indicated by the solid connections, the neural cell in the proposed GDAS is a sampled sub-graph of this DAG. Specifically, among the intermediate features between every two nodes, GDAS samples one feature in a differentiable way.
### Requirements
2019-03-31 16:49:43 +02:00
- PyTorch 1.0.1
2019-01-31 15:27:38 +01:00
- Python 3.6
2019-01-31 18:03:35 +01:00
- opencv
2019-01-31 15:27:38 +01:00
```
conda install pytorch torchvision cuda100 -c pytorch
```
2019-04-02 11:06:25 +02:00
### Usages
2019-01-31 15:27:38 +01:00
2019-01-31 17:23:55 +01:00
Train the searched CNN on CIFAR
```
2019-03-30 06:38:15 +01:00
CUDA_VISIBLE_DEVICES=0 bash ./scripts-cnn/train-cifar.sh GDAS_FG cifar10 cut
CUDA_VISIBLE_DEVICES=0 bash ./scripts-cnn/train-cifar.sh GDAS_F1 cifar10 cut
CUDA_VISIBLE_DEVICES=0 bash ./scripts-cnn/train-cifar.sh GDAS_V1 cifar100 cut
2019-01-31 17:23:55 +01:00
```
Train the searched CNN on ImageNet
```
2019-03-30 06:38:15 +01:00
CUDA_VISIBLE_DEVICES=0 bash ./scripts-cnn/train-imagenet.sh GDAS_F1 52 14
CUDA_VISIBLE_DEVICES=0 bash ./scripts-cnn/train-imagenet.sh GDAS_V1 50 14
2019-01-31 17:23:55 +01:00
```
2019-03-31 16:49:43 +02:00
Evaluate a trained CNN model
```
CUDA_VISIBLE_DEVICES=0 python ./exps-cnn/evaluate.py --data_path $TORCH_HOME/cifar.python --checkpoint ${checkpoint-path}
CUDA_VISIBLE_DEVICES=0 python ./exps-cnn/evaluate.py --data_path $TORCH_HOME/ILSVRC2012 --checkpoint ${checkpoint-path}
```
2019-01-31 17:23:55 +01:00
Train the searched RNN
2019-01-31 16:40:20 +01:00
```
2019-03-29 17:50:18 +01:00
CUDA_VISIBLE_DEVICES=0 bash ./scripts-rnn/train-PTB.sh DARTS_V1
CUDA_VISIBLE_DEVICES=0 bash ./scripts-rnn/train-PTB.sh DARTS_V2
CUDA_VISIBLE_DEVICES=0 bash ./scripts-rnn/train-PTB.sh GDAS
CUDA_VISIBLE_DEVICES=0 bash ./scripts-rnn/train-WT2.sh DARTS_V1
CUDA_VISIBLE_DEVICES=0 bash ./scripts-rnn/train-WT2.sh DARTS_V2
CUDA_VISIBLE_DEVICES=0 bash ./scripts-rnn/train-WT2.sh GDAS
2019-01-31 16:40:20 +01:00
```
2019-03-31 16:49:43 +02:00
2019-04-02 11:06:25 +02:00
### Training Logs
2019-04-01 16:24:56 +02:00
Some training logs can be found in `./data/logs/`, and some pre-trained models can be found in [Google Driver](https://drive.google.com/open?id=1Ofhc49xC1PLIX4O708gJZ1ugzz4td_RJ).
2019-04-02 11:06:25 +02:00
### Experimental Results
<img src="data/imagenet-results.png" width="600">
Figure 2. Top-1 and top-5 errors on ImageNet.
### Citation
2019-03-31 16:49:43 +02:00
```
@inproceedings{dong2019search,
title={Searching for A Robust Neural Architecture in Four GPU Hours},
author={Dong, Xuanyi and Yang, Yi},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2019}
}
```