diff --git a/demo/intro.jpg b/.figure/intro.jpg
similarity index 100%
rename from demo/intro.jpg
rename to .figure/intro.jpg
diff --git a/AutoFormer/.figure/details.gif b/AutoFormer/.figure/details.gif
new file mode 100644
index 00000000..77bcdf6a
Binary files /dev/null and b/AutoFormer/.figure/details.gif differ
diff --git a/AutoFormer/.figure/ofa.png b/AutoFormer/.figure/ofa.png
new file mode 100644
index 00000000..df68dd00
Binary files /dev/null and b/AutoFormer/.figure/ofa.png differ
diff --git a/AutoFormer/.figure/overview.gif b/AutoFormer/.figure/overview.gif
new file mode 100644
index 00000000..fc3b873f
Binary files /dev/null and b/AutoFormer/.figure/overview.gif differ
diff --git a/AutoFormer/.figure/performance.png b/AutoFormer/.figure/performance.png
new file mode 100644
index 00000000..01290836
Binary files /dev/null and b/AutoFormer/.figure/performance.png differ
diff --git a/AutoFormer/README.md b/AutoFormer/README.md
new file mode 100644
index 00000000..4475b927
--- /dev/null
+++ b/AutoFormer/README.md
@@ -0,0 +1,30 @@
+# AutoFormer: Searching Transformers for Visual Recognition
+
+## code is coming soon
+
+This is an official implementation of AutoFormer.
+
+
+
![AutoFormer overview](.figure/overview.gif)
+
![AutoFormer overview](.figure/details.gif)
+
+
+
+## Highlights
+- Once-for-all
+
+AutoFormer is a simple yet effective method to train a once-for-all vision transformer supernet.
+
+- Competive performance
+
+AutoFormer is consistently outperform DeiTs.
+
+## Performance
+
+**Left:** Top-1 accuracy on ImageNet. Our method achieves very competitive performance, being superior to the recent DeiT and ViT. **Right:** 1000 random sampled good architectures in the supernet-S. The supernet trained under our strategy allows subnets to be well optimized.
+
+
+
![](.figure/performance.png)
+
![](.figure/ofa.png)
+
+
diff --git a/Cream/README.md b/Cream/README.md
new file mode 100644
index 00000000..ce51df0d
--- /dev/null
+++ b/Cream/README.md
@@ -0,0 +1,148 @@
+Hiring research interns for neural architecture search projects: houwen.peng@microsoft.com
+
+# Cream of the Crop: Distilling Prioritized Paths For One-Shot Neural Architecture Search
+This is an official implementation for our Cream NAS work presented in NeurIPS'20.
+
+**[[Paper]](https://papers.nips.cc/paper/2020/file/d072677d210ac4c03ba046120f0802ec-Paper.pdf) [[Models-Google Drive]](https://drive.google.com/drive/folders/1NLGAbBF9bA1IUAxKlk2VjgRXhr6RHvRW?usp=sharing)[[Models-Baidu Disk (password: wqw6)]](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g) [[Slides]]() [[BibTex]](https://scholar.googleusercontent.com/scholar.bib?q=info:ICWVXc_SsKAJ:scholar.google.com/&output=citation&scisdr=CgUmooXfEMfTi0cV5aU:AAGBfm0AAAAAX7sQ_aXoamdKRaBI12tAVN8REq1VKNwM&scisig=AAGBfm0AAAAAX7sQ_RdYtp6BSro3zgbXVJU2MCgsG730&scisf=4&ct=citation&cd=-1&hl=ja)**
+
+In this work, we present a simple yet effective architecture distillation method. The central idea is that subnetworks can learn collaboratively and teach each other throughout the training process, aiming to boost the convergence of individual models. We introduce the concept of prioritized path, which refers to the architecture candidates exhibiting superior performance during training. Distilling knowledge from the prioritized paths is able to boost the training of subnetworks. Since the prioritized paths are changed on the fly depending on their performance and complexity, the final obtained paths are the cream of the crop.
+
+
![](./demo/intro.jpg)
+
+
+## Environment Setup
+
+To set up the enviroment you can easily run the following command:
+```buildoutcfg
+git clone https://github.com/mapleam/Cream.git
+cd Cream
+conda create -n Cream python=3.6
+conda activate Cream
+pip install -r requirements
+
+# (required) install apex to accelerate the training, a little bit faster than pytorch DistributedDataParallel
+cd lib
+git clone https://github.com/NVIDIA/apex.git
+python ./apex/setup.py install --cpp_ext --cuda_ext
+```
+
+## Data Preparation
+You need to first download the [ImageNet-2012](http://www.image-net.org/) to the folder `./data/imagenet` and move the validation set to the subfolder `./data/imagenet/val`. To move the validation set, you cloud use the following script: *[todo]*
+
+Put the imagenet data in ./data. It should look like:
+```buildoutcfg
+./data/imagenet/train
+./data/imagenet/val
+...
+```
+
+## Checkpoints For Test
+For quick test, we have stored the checkpoints of our models in [Google Drive](https://drive.google.com/drive/folders/1NLGAbBF9bA1IUAxKlk2VjgRXhr6RHvRW?usp=sharing) (or [Baidu Disk (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)).
+
+Just download the checkpoints from [Google Drive](https://drive.google.com/drive/folders/1NLGAbBF9bA1IUAxKlk2VjgRXhr6RHvRW?usp=sharing) (or [Baidu Disk](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)) and put the checkpoints in `./experiments/workspace/ckps/`.
+
+Then you can do the test right now (as described in the following *Quick Start, III. Test*).
+
+Model download links:
+Model | FLOPs | Top-1 Acc. % | Top-5 Acc. % | Link
+--- |:---:|:---:|:---:|:---:
+Cream_14 | 14M | 53.8 | 77.2 | [Google](https://drive.google.com/file/d/19knbGCUlU9DYJp9En8mzQ3o390Q0gJeB/view?usp=sharing) / [Baidu (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)
+Cream_43 | 43M | 66.3 | 86.7 | [Google](https://drive.google.com/file/d/1ILTXIuIqkN_WMfBd3lc6r-dNeADULYna/view?usp=sharing) / [Baidu (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)
+Cream_114 | 114M | 72.8 | 90.8 | [Google](https://drive.google.com/file/d/1DPoCEF0CufRsGyY5_iyCmeb0gT21knQG/view?usp=sharing) / [Baidu (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)
+Cream_287 | 287M | 77.6 | 93.3 | [Google](https://drive.google.com/file/d/1F3cbpmr91vwzlcoGZauqieRm5Ca0glZ_/view?usp=sharing) / [Baidu (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)
+Cream_481 | 481M | 79.2 | 94.2 | [Google](https://drive.google.com/file/d/1RzJBr7wc1XolNtw8TvMDRPeFzyRypuS9/view?usp=sharing) / [Baidu (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)
+Cream_604 | 604M | 80.0 | 94.7 | [Google](https://drive.google.com/file/d/18ZUkgxIGqQ0DaW1oTAVsL0JT1l0YAX1K/view?usp=sharing) / [Baidu (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)
+
+
+
+## Quick Start
+We provide *search*, *retrain* and *test* code of our Cream NAS algorithm as follows.
+
+### I. Search
+To search for an architecture, you need to configure the parameters `FLOPS_MINIMUM` and `FLOPS_MAXIMUM` to specify the desired model Flops, for example, pick up a value from 0 to 600 MB Flops. You can specify the Flops interval [`FLOPS_MINIMUM`, `FLOPS_MAXIMUM`] in the YAML configure file: `./experiments/configs/train/train.yaml`.
+```buildoutcfg
+Line 51:FLOPS_MINIMUM: 0 # Minimum Flops of Architecture
+Line 52:FLOPS_MAXIMUM: 600 # Maximum Flops of Architecture
+```
+
+After you specify the Flops of the architectures, you can search an architecture now by running:
+```buildoutcfg
+python ./tools/main.py train ./experiments/configs/train/train.yaml
+```
+
+### II. Retrain
+We also give the architecture we searched. To train those architectures, you need to configure the parameter `MODEL_SELECTION` to specify the model Flops. To specify which model to train, you should add `MODEL_SELECTION` in `./experiments/configs/retrain/retrain.yaml`. You can select one from [14,43,114,287,481,604], which stands for different Flops(MB).
+```buildoutcfg
+MODEL_SELECTION: 43 # Retrain 43m model
+MODEL_SELECTION: 481 # Retrain 481m model
+......
+```
+
+After specifying the Flops, you need to choose the config settings in `./experiments/configs/retrain/retrain.yaml`. The config files are in `./expperiments/configs/retrain`
+```buildoutcfg
+./experiments/configs/retrain/43.yaml
+./experiments/configs/retrain/481.yaml
+......
+```
+
+After adding `MODEL_SELECTION` in `retrain.yaml`, you need to use the following command to train the model.
+```buildoutcfg
+python ./tools/main.py retrain ./experiments/configs/retrain/retrain.yaml
+```
+
+The trained model and log file will be saved in `./experiments/workspace/retrain`. You can configure the `SAVE_PATH` in `./experiments/configs/retrain/retrain.yaml` to specify a path for saving the model and log file.
+
+### III. Test
+To test our trained of models, you need to use `MODEL_SELECTION` in `./experiments/configs/test/test.yaml` to specify which model to test.
+```buildoutcfg
+MODEL_SELECTION: 43 # test 43m model
+MODEL_SELECTION: 481 # test 481m model
+......
+```
+
+After specifying the Flops of the model, you need to write the path to the resume model in `./experiments/configs/test/test.yaml`.
+```buildoutcfg
+RESUME_PATH: './experiments/workspace/ckps/43.pth.tar'
+RESUME_PATH: './experiments/workspace/ckps/481.pth.tar'
+......
+```
+
+After adding `MODEL_SELECTION` and `RESUME_PATH` in `./experiments/configs/test/test.yaml`, you need to use the following command to test the model.
+```buildoutcfg
+python ./tools/main.py test ./experiments/configs/test/test.yaml
+```
+
+The test result will be saved in `./experiments/workspace/test`. You can configure the `SAVE_PATH` in `./experiments/configs/test/test.yaml` to specify a path for it.
+
+##### Test Rank Correlation
+
+To perform a correlation analysis, we randomly sample 30 subnetworks from the hypernetwork and calculate the rank correlation between the weight sharing performance and the true performance of training from scratch. Unfortunately, training these subnetworks on ImageNet is very computational expensive, we thus construct a subImageNet dataset, which only consists of 100 classes randomly sampled from ImageNet. Each class has 250 training images and 50 validation images. We can generate the imagelist by running the following script:
+
+```buildoutcfg
+python ./tools/generate_subImageNet.py
+```
+Thus we get the subImageNet in `./data/subImagnet`. The class list is provided in `./data/subclass_list.txt`. The images list is provided in `./data/subimages_list.txt`
+
+
+## Performance
+The top-1 accuracy on ImageNet. Our method achieves very competitive performance, being superior to the recent MobileNetV3 and EfficientNet-B0/B1.
+
+
+
![](./demo/results_600.jpg)
+
![](./demo/results_100.jpg)
+
+
+## BibTex
+```
+@article{Cream,
+ title={Cream of the Crop: Distilling Prioritized Paths For One-Shot Neural Architecture Search},
+ author={Peng, Houwen and Du, Hao and Yu, Hongyuan and Li, Qi and Liao, Jing and Fu, Jianlong},
+ journal={Advances in Neural Information Processing Systems},
+ volume={33},
+ year={2020}
+}
+```
+
+## License
+License under an MIT license.
+
diff --git a/data/subclass_list.txt b/Cream/data/subclass_list.txt
similarity index 100%
rename from data/subclass_list.txt
rename to Cream/data/subclass_list.txt
diff --git a/data/subimages_list.txt b/Cream/data/subimages_list.txt
similarity index 100%
rename from data/subimages_list.txt
rename to Cream/data/subimages_list.txt
diff --git a/Cream/demo/intro.jpg b/Cream/demo/intro.jpg
new file mode 100644
index 00000000..f0096f3a
Binary files /dev/null and b/Cream/demo/intro.jpg differ
diff --git a/demo/results_100.jpg b/Cream/demo/results_100.jpg
similarity index 100%
rename from demo/results_100.jpg
rename to Cream/demo/results_100.jpg
diff --git a/demo/results_600.jpg b/Cream/demo/results_600.jpg
similarity index 100%
rename from demo/results_600.jpg
rename to Cream/demo/results_600.jpg
diff --git a/experiments/configs/retrain/114.yaml b/Cream/experiments/configs/retrain/114.yaml
similarity index 100%
rename from experiments/configs/retrain/114.yaml
rename to Cream/experiments/configs/retrain/114.yaml
diff --git a/experiments/configs/retrain/14.yaml b/Cream/experiments/configs/retrain/14.yaml
similarity index 100%
rename from experiments/configs/retrain/14.yaml
rename to Cream/experiments/configs/retrain/14.yaml
diff --git a/experiments/configs/retrain/23.yaml b/Cream/experiments/configs/retrain/23.yaml
similarity index 100%
rename from experiments/configs/retrain/23.yaml
rename to Cream/experiments/configs/retrain/23.yaml
diff --git a/experiments/configs/retrain/287.yaml b/Cream/experiments/configs/retrain/287.yaml
similarity index 100%
rename from experiments/configs/retrain/287.yaml
rename to Cream/experiments/configs/retrain/287.yaml
diff --git a/experiments/configs/retrain/43.yaml b/Cream/experiments/configs/retrain/43.yaml
similarity index 100%
rename from experiments/configs/retrain/43.yaml
rename to Cream/experiments/configs/retrain/43.yaml
diff --git a/experiments/configs/retrain/481.yaml b/Cream/experiments/configs/retrain/481.yaml
similarity index 100%
rename from experiments/configs/retrain/481.yaml
rename to Cream/experiments/configs/retrain/481.yaml
diff --git a/experiments/configs/retrain/604.yaml b/Cream/experiments/configs/retrain/604.yaml
similarity index 100%
rename from experiments/configs/retrain/604.yaml
rename to Cream/experiments/configs/retrain/604.yaml
diff --git a/experiments/configs/retrain/72.yaml b/Cream/experiments/configs/retrain/72.yaml
similarity index 100%
rename from experiments/configs/retrain/72.yaml
rename to Cream/experiments/configs/retrain/72.yaml
diff --git a/experiments/configs/retrain/retrain.yaml b/Cream/experiments/configs/retrain/retrain.yaml
similarity index 100%
rename from experiments/configs/retrain/retrain.yaml
rename to Cream/experiments/configs/retrain/retrain.yaml
diff --git a/experiments/configs/test/test.yaml b/Cream/experiments/configs/test/test.yaml
similarity index 100%
rename from experiments/configs/test/test.yaml
rename to Cream/experiments/configs/test/test.yaml
diff --git a/experiments/configs/train/train.yaml b/Cream/experiments/configs/train/train.yaml
similarity index 100%
rename from experiments/configs/train/train.yaml
rename to Cream/experiments/configs/train/train.yaml
diff --git a/experiments/workspace/ckps/42.pth.tar b/Cream/experiments/workspace/ckps/42.pth.tar
similarity index 100%
rename from experiments/workspace/ckps/42.pth.tar
rename to Cream/experiments/workspace/ckps/42.pth.tar
diff --git a/experiments/workspace/retrain/README.md b/Cream/experiments/workspace/retrain/README.md
similarity index 100%
rename from experiments/workspace/retrain/README.md
rename to Cream/experiments/workspace/retrain/README.md
diff --git a/experiments/workspace/test/README.md b/Cream/experiments/workspace/test/README.md
similarity index 100%
rename from experiments/workspace/test/README.md
rename to Cream/experiments/workspace/test/README.md
diff --git a/experiments/workspace/train/README.md b/Cream/experiments/workspace/train/README.md
similarity index 100%
rename from experiments/workspace/train/README.md
rename to Cream/experiments/workspace/train/README.md
diff --git a/lib/config.py b/Cream/lib/config.py
similarity index 100%
rename from lib/config.py
rename to Cream/lib/config.py
diff --git a/lib/core/retrain.py b/Cream/lib/core/retrain.py
similarity index 100%
rename from lib/core/retrain.py
rename to Cream/lib/core/retrain.py
diff --git a/lib/core/test.py b/Cream/lib/core/test.py
similarity index 100%
rename from lib/core/test.py
rename to Cream/lib/core/test.py
diff --git a/lib/core/train.py b/Cream/lib/core/train.py
similarity index 100%
rename from lib/core/train.py
rename to Cream/lib/core/train.py
diff --git a/lib/models/MetaMatchingNetwork.py b/Cream/lib/models/MetaMatchingNetwork.py
similarity index 100%
rename from lib/models/MetaMatchingNetwork.py
rename to Cream/lib/models/MetaMatchingNetwork.py
diff --git a/lib/models/PrioritizedBoard.py b/Cream/lib/models/PrioritizedBoard.py
similarity index 100%
rename from lib/models/PrioritizedBoard.py
rename to Cream/lib/models/PrioritizedBoard.py
diff --git a/lib/models/blocks/__init__.py b/Cream/lib/models/blocks/__init__.py
similarity index 100%
rename from lib/models/blocks/__init__.py
rename to Cream/lib/models/blocks/__init__.py
diff --git a/lib/models/blocks/inverted_residual_block.py b/Cream/lib/models/blocks/inverted_residual_block.py
similarity index 100%
rename from lib/models/blocks/inverted_residual_block.py
rename to Cream/lib/models/blocks/inverted_residual_block.py
diff --git a/lib/models/blocks/residual_block.py b/Cream/lib/models/blocks/residual_block.py
similarity index 100%
rename from lib/models/blocks/residual_block.py
rename to Cream/lib/models/blocks/residual_block.py
diff --git a/lib/models/builders/build_childnet.py b/Cream/lib/models/builders/build_childnet.py
similarity index 100%
rename from lib/models/builders/build_childnet.py
rename to Cream/lib/models/builders/build_childnet.py
diff --git a/lib/models/builders/build_supernet.py b/Cream/lib/models/builders/build_supernet.py
similarity index 100%
rename from lib/models/builders/build_supernet.py
rename to Cream/lib/models/builders/build_supernet.py
diff --git a/lib/models/structures/childnet.py b/Cream/lib/models/structures/childnet.py
similarity index 100%
rename from lib/models/structures/childnet.py
rename to Cream/lib/models/structures/childnet.py
diff --git a/lib/models/structures/supernet.py b/Cream/lib/models/structures/supernet.py
similarity index 100%
rename from lib/models/structures/supernet.py
rename to Cream/lib/models/structures/supernet.py
diff --git a/lib/utils/builder_util.py b/Cream/lib/utils/builder_util.py
similarity index 100%
rename from lib/utils/builder_util.py
rename to Cream/lib/utils/builder_util.py
diff --git a/lib/utils/flops_table.py b/Cream/lib/utils/flops_table.py
similarity index 100%
rename from lib/utils/flops_table.py
rename to Cream/lib/utils/flops_table.py
diff --git a/lib/utils/op_by_layer_dict.py b/Cream/lib/utils/op_by_layer_dict.py
similarity index 100%
rename from lib/utils/op_by_layer_dict.py
rename to Cream/lib/utils/op_by_layer_dict.py
diff --git a/lib/utils/search_structure_supernet.py b/Cream/lib/utils/search_structure_supernet.py
similarity index 100%
rename from lib/utils/search_structure_supernet.py
rename to Cream/lib/utils/search_structure_supernet.py
diff --git a/lib/utils/util.py b/Cream/lib/utils/util.py
similarity index 100%
rename from lib/utils/util.py
rename to Cream/lib/utils/util.py
diff --git a/requirements b/Cream/requirements
similarity index 100%
rename from requirements
rename to Cream/requirements
diff --git a/tools/_init_paths.py b/Cream/tools/_init_paths.py
similarity index 100%
rename from tools/_init_paths.py
rename to Cream/tools/_init_paths.py
diff --git a/tools/generate_subImageNet.py b/Cream/tools/generate_subImageNet.py
similarity index 100%
rename from tools/generate_subImageNet.py
rename to Cream/tools/generate_subImageNet.py
diff --git a/tools/main.py b/Cream/tools/main.py
similarity index 100%
rename from tools/main.py
rename to Cream/tools/main.py
diff --git a/tools/retrain.py b/Cream/tools/retrain.py
similarity index 100%
rename from tools/retrain.py
rename to Cream/tools/retrain.py
diff --git a/tools/test.py b/Cream/tools/test.py
similarity index 100%
rename from tools/test.py
rename to Cream/tools/test.py
diff --git a/tools/train.py b/Cream/tools/train.py
similarity index 100%
rename from tools/train.py
rename to Cream/tools/train.py
diff --git a/README.md b/README.md
index ce51df0d..695c7fba 100644
--- a/README.md
+++ b/README.md
@@ -1,147 +1,41 @@
-Hiring research interns for neural architecture search projects: houwen.peng@microsoft.com
+# AutoML
-# Cream of the Crop: Distilling Prioritized Paths For One-Shot Neural Architecture Search
-This is an official implementation for our Cream NAS work presented in NeurIPS'20.
+***This a collection of AutoML works at MSRA MSM***
+> [**Cream**](https://github.com/microsoft/AutoML/tree/main/Cream) (```@NeurIPS'20```): **Cream of the Crop: Distilling Prioritized Paths For One-Shot Neural Architecture Search**
+
+> [**AutoFormer**](https://github.com/microsoft/AutoML/tree/main/AutoFormer)(```NEW```): **AutoFormer: Searching Transformers for Visual Recognition**
+
+
+## News
+- :boom: July, 2021: [**AutoFormer**](https://github.com/microsoft/AutoML/tree/main/AutoFormer) is now available on arxiv.
+- :boom: Oct, 2020: Code for [**Cream**](https://github.com/microsoft/AutoML/tree/main/Cream) is now released.
+- :boom: Oct, 2020: [**Cream**](https://github.com/microsoft/AutoML/tree/main/Cream) was accepted to NeurIPS'20
+
+## Works
+
+### AutoFormer
+
+***Coming soon!!!***
+
+AutoFormer is new one-shot architecture search framework dedicated to vision transformer search. It entangles the weights of different vision transformer blocks in the same layers during supernet training.
+Benefiting from the strategy, the trained supernet allows thousands of subnets to be very well-trained. Specifically, the performance of these subnets with weights inherited from the supernet is comparable to those retrained from scratch.
+
+
![AutoFormer overview](AutoFormer/.figure/overview.gif)
+
![AutoFormer overview](AutoFormer/.figure/details.gif)
+
+
+
+### Cream
**[[Paper]](https://papers.nips.cc/paper/2020/file/d072677d210ac4c03ba046120f0802ec-Paper.pdf) [[Models-Google Drive]](https://drive.google.com/drive/folders/1NLGAbBF9bA1IUAxKlk2VjgRXhr6RHvRW?usp=sharing)[[Models-Baidu Disk (password: wqw6)]](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g) [[Slides]]() [[BibTex]](https://scholar.googleusercontent.com/scholar.bib?q=info:ICWVXc_SsKAJ:scholar.google.com/&output=citation&scisdr=CgUmooXfEMfTi0cV5aU:AAGBfm0AAAAAX7sQ_aXoamdKRaBI12tAVN8REq1VKNwM&scisig=AAGBfm0AAAAAX7sQ_RdYtp6BSro3zgbXVJU2MCgsG730&scisf=4&ct=citation&cd=-1&hl=ja)**
In this work, we present a simple yet effective architecture distillation method. The central idea is that subnetworks can learn collaboratively and teach each other throughout the training process, aiming to boost the convergence of individual models. We introduce the concept of prioritized path, which refers to the architecture candidates exhibiting superior performance during training. Distilling knowledge from the prioritized paths is able to boost the training of subnetworks. Since the prioritized paths are changed on the fly depending on their performance and complexity, the final obtained paths are the cream of the crop.
-
![](./demo/intro.jpg)
+
-## Environment Setup
-
-To set up the enviroment you can easily run the following command:
-```buildoutcfg
-git clone https://github.com/mapleam/Cream.git
-cd Cream
-conda create -n Cream python=3.6
-conda activate Cream
-pip install -r requirements
-
-# (required) install apex to accelerate the training, a little bit faster than pytorch DistributedDataParallel
-cd lib
-git clone https://github.com/NVIDIA/apex.git
-python ./apex/setup.py install --cpp_ext --cuda_ext
-```
-
-## Data Preparation
-You need to first download the [ImageNet-2012](http://www.image-net.org/) to the folder `./data/imagenet` and move the validation set to the subfolder `./data/imagenet/val`. To move the validation set, you cloud use the following script: *[todo]*
-
-Put the imagenet data in ./data. It should look like:
-```buildoutcfg
-./data/imagenet/train
-./data/imagenet/val
-...
-```
-
-## Checkpoints For Test
-For quick test, we have stored the checkpoints of our models in [Google Drive](https://drive.google.com/drive/folders/1NLGAbBF9bA1IUAxKlk2VjgRXhr6RHvRW?usp=sharing) (or [Baidu Disk (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)).
-
-Just download the checkpoints from [Google Drive](https://drive.google.com/drive/folders/1NLGAbBF9bA1IUAxKlk2VjgRXhr6RHvRW?usp=sharing) (or [Baidu Disk](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)) and put the checkpoints in `./experiments/workspace/ckps/`.
-
-Then you can do the test right now (as described in the following *Quick Start, III. Test*).
-
-Model download links:
-Model | FLOPs | Top-1 Acc. % | Top-5 Acc. % | Link
---- |:---:|:---:|:---:|:---:
-Cream_14 | 14M | 53.8 | 77.2 | [Google](https://drive.google.com/file/d/19knbGCUlU9DYJp9En8mzQ3o390Q0gJeB/view?usp=sharing) / [Baidu (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)
-Cream_43 | 43M | 66.3 | 86.7 | [Google](https://drive.google.com/file/d/1ILTXIuIqkN_WMfBd3lc6r-dNeADULYna/view?usp=sharing) / [Baidu (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)
-Cream_114 | 114M | 72.8 | 90.8 | [Google](https://drive.google.com/file/d/1DPoCEF0CufRsGyY5_iyCmeb0gT21knQG/view?usp=sharing) / [Baidu (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)
-Cream_287 | 287M | 77.6 | 93.3 | [Google](https://drive.google.com/file/d/1F3cbpmr91vwzlcoGZauqieRm5Ca0glZ_/view?usp=sharing) / [Baidu (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)
-Cream_481 | 481M | 79.2 | 94.2 | [Google](https://drive.google.com/file/d/1RzJBr7wc1XolNtw8TvMDRPeFzyRypuS9/view?usp=sharing) / [Baidu (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)
-Cream_604 | 604M | 80.0 | 94.7 | [Google](https://drive.google.com/file/d/18ZUkgxIGqQ0DaW1oTAVsL0JT1l0YAX1K/view?usp=sharing) / [Baidu (password: wqw6)](https://pan.baidu.com/s/1TqQNm2s14oEdyNPimw3T9g)
-
-
-
-## Quick Start
-We provide *search*, *retrain* and *test* code of our Cream NAS algorithm as follows.
-
-### I. Search
-To search for an architecture, you need to configure the parameters `FLOPS_MINIMUM` and `FLOPS_MAXIMUM` to specify the desired model Flops, for example, pick up a value from 0 to 600 MB Flops. You can specify the Flops interval [`FLOPS_MINIMUM`, `FLOPS_MAXIMUM`] in the YAML configure file: `./experiments/configs/train/train.yaml`.
-```buildoutcfg
-Line 51:FLOPS_MINIMUM: 0 # Minimum Flops of Architecture
-Line 52:FLOPS_MAXIMUM: 600 # Maximum Flops of Architecture
-```
-
-After you specify the Flops of the architectures, you can search an architecture now by running:
-```buildoutcfg
-python ./tools/main.py train ./experiments/configs/train/train.yaml
-```
-
-### II. Retrain
-We also give the architecture we searched. To train those architectures, you need to configure the parameter `MODEL_SELECTION` to specify the model Flops. To specify which model to train, you should add `MODEL_SELECTION` in `./experiments/configs/retrain/retrain.yaml`. You can select one from [14,43,114,287,481,604], which stands for different Flops(MB).
-```buildoutcfg
-MODEL_SELECTION: 43 # Retrain 43m model
-MODEL_SELECTION: 481 # Retrain 481m model
-......
-```
-
-After specifying the Flops, you need to choose the config settings in `./experiments/configs/retrain/retrain.yaml`. The config files are in `./expperiments/configs/retrain`
-```buildoutcfg
-./experiments/configs/retrain/43.yaml
-./experiments/configs/retrain/481.yaml
-......
-```
-
-After adding `MODEL_SELECTION` in `retrain.yaml`, you need to use the following command to train the model.
-```buildoutcfg
-python ./tools/main.py retrain ./experiments/configs/retrain/retrain.yaml
-```
-
-The trained model and log file will be saved in `./experiments/workspace/retrain`. You can configure the `SAVE_PATH` in `./experiments/configs/retrain/retrain.yaml` to specify a path for saving the model and log file.
-
-### III. Test
-To test our trained of models, you need to use `MODEL_SELECTION` in `./experiments/configs/test/test.yaml` to specify which model to test.
-```buildoutcfg
-MODEL_SELECTION: 43 # test 43m model
-MODEL_SELECTION: 481 # test 481m model
-......
-```
-
-After specifying the Flops of the model, you need to write the path to the resume model in `./experiments/configs/test/test.yaml`.
-```buildoutcfg
-RESUME_PATH: './experiments/workspace/ckps/43.pth.tar'
-RESUME_PATH: './experiments/workspace/ckps/481.pth.tar'
-......
-```
-
-After adding `MODEL_SELECTION` and `RESUME_PATH` in `./experiments/configs/test/test.yaml`, you need to use the following command to test the model.
-```buildoutcfg
-python ./tools/main.py test ./experiments/configs/test/test.yaml
-```
-
-The test result will be saved in `./experiments/workspace/test`. You can configure the `SAVE_PATH` in `./experiments/configs/test/test.yaml` to specify a path for it.
-
-##### Test Rank Correlation
-
-To perform a correlation analysis, we randomly sample 30 subnetworks from the hypernetwork and calculate the rank correlation between the weight sharing performance and the true performance of training from scratch. Unfortunately, training these subnetworks on ImageNet is very computational expensive, we thus construct a subImageNet dataset, which only consists of 100 classes randomly sampled from ImageNet. Each class has 250 training images and 50 validation images. We can generate the imagelist by running the following script:
-
-```buildoutcfg
-python ./tools/generate_subImageNet.py
-```
-Thus we get the subImageNet in `./data/subImagnet`. The class list is provided in `./data/subclass_list.txt`. The images list is provided in `./data/subimages_list.txt`
-
-
-## Performance
-The top-1 accuracy on ImageNet. Our method achieves very competitive performance, being superior to the recent MobileNetV3 and EfficientNet-B0/B1.
-
-
-
![](./demo/results_600.jpg)
-
![](./demo/results_100.jpg)
-
-## BibTex
-```
-@article{Cream,
- title={Cream of the Crop: Distilling Prioritized Paths For One-Shot Neural Architecture Search},
- author={Peng, Houwen and Du, Hao and Yu, Hongyuan and Li, Qi and Liao, Jing and Fu, Jianlong},
- journal={Advances in Neural Information Processing Systems},
- volume={33},
- year={2020}
-}
-```
+
## License
License under an MIT license.