facebookresearch / unnas

Code for "Are labels necessary for neural architecture search"
MIT License
92 stars 15 forks source link

unnas

This is the code and data release for the Are Labels Necessary for Neural Architecture Search? project. It is a superset of the pycls codebase written in PyTorch, by supporting more:

unnas supports a wide range of tasks, datasets, backbones, and modes for neural architecture related research.

Using unnas

In addition to installing PyTorch with CUDA support, run:

cd /path/to/clone/unnas
git clone https://github.com/facebookresearch/unnas
cd unnas
pip install -r requirements.txt
export PYTHONPATH=.

Then please follow DATA.md to set up the datasets.

All experiments were conducted using (up to 8) Nvidia Quadro GV100, each with 32GB memory. If you are using GPUs with smaller memory, the provided configs may result in out-of-memory error.

Sample-Based Experiments

To train an architecture used in sample-based experiments:

python tools/train_net.py \
    --cfg configs/sample_based/SPACE/DATASET/TASK/ID.yaml \
    OUT_DIR tmp

where:

To use different random seeds (e.g. 2), simply append RNG_SEED 2 to the command. To obtain our results of these runs:

wget https://dl.fbaipublicfiles.com/unnas/unnas_summaries.zip
unzip unnas_summaries.zip
rm unnas_summaries.zip

Repeating our analysis is essentially equivalent to generating the figures in the paper. To do so:

python figs/fig234.py
python figs/fig5.py

The generated figures will be under the figs/ folder.

Search-Based Experiments

To repeat the search phase:

python tools/train_net.py \
    --cfg configs/search_based/search_phase/DATASET/TASK.yaml \
    OUT_DIR tmp

where:

To repeat the evaluation phase:

python tools/train_net.py \
    --cfg configs/search_based/eval_phase/TASK/ARCH.yaml \
    OUT_DIR tmp

where:

For either phase, to use different random seeds (e.g. 2), simply append RNG_SEED 2 to the command.

Citing unnas

If you find unnas helpful in your research, please consider citing:

@InProceedings{Liu2020,
  title = {Are Labels Necessary for Neural Architecture Search?},
  author = {Liu, Chenxi and Doll{\'a}r, Piotr and He, Kaiming and Girshick, Ross and Yuille, Alan and Xie, Saining},
  booktitle = {ECCV},
  year = {2020}
}

License

unnas is released under the MIT license. Please see the LICENSE file for more information.