mindspore/model_zoo/research/cv/renas
chenhaozhe 9da8534396 change _Loss to Loss 2021-06-03 15:26:59 +08:00
..
src change _Loss to Loss 2021-06-03 15:26:59 +08:00
Readme.md fixed the bad links 2021-04-09 14:41:59 +08:00
eval.py add renas&manidp 2021-04-07 20:21:49 +08:00
mindpsore_hub_conf.py add renas&manidp 2021-04-07 20:21:49 +08:00

Readme.md

Contents

ReNAS Description

An effective and efficient architecture performance evaluation scheme is essential for the success of Neural Architecture Search (NAS). To save computational cost, most of existing NAS algorithms often train and evaluate intermediate neural architectures on a small proxy dataset with limited training epochs. But it is difficult to expect an accurate performance estimation of an architecture in such a coarse evaluation way. This paper advocates a new neural architecture evaluation scheme, which aims to determine which architecture would perform better instead of accurately predict the absolute architecture performance. Therefore, we propose a \textbf{relativistic} architecture performance predictor in NAS (ReNAS). We encode neural architectures into feature tensors, and further refining the representations with the predictor. The proposed relativistic performance predictor can be deployed in discrete searching methods to search for the desired architectures without additional evaluation. Experimental results on NAS-Bench-101 dataset suggests that, sampling 424 (0.1\% of the entire search space) neural architectures and their corresponding validation performance is already enough for learning an accurate architecture performance predictor. The accuracies of our searched neural architectures on NAS-Bench-101 and NAS-Bench-201 datasets are higher than that of the state-of-the-art methods and show the priority of the proposed method.

Paper: Yixing Xu, Yunhe Wang, Kai Han, Yehui Tang, Shangling Jui, Chunjing Xu, Chang Xu. ReNAS: Relativistic Evaluation of Neural Architecture Search. Submitted to CVPR 2021.

Dataset

  • Dataset used: CIFAR-10
    • Dataset size: 60000 colorful images in 10 classes
      • Train: 50000 images
      • Test: 10000 images
    • Data format: RGB images.
      • Note: Data will be processed in src/dataset.py

Features

Mixed Precision(Ascend)

The mixed precision training method accelerates the deep learning neural network training process by using both the single-precision and half-precision data formats, and maintains the network precision achieved by the single-precision training at the same time. Mixed precision training can accelerate the computation process, reduce memory usage, and enable a larger model or batch size to be trained on specific hardware. For FP16 operators, if the input data type is FP32, the backend of MindSpore will automatically handle it with reduced precision. Users could check the reduced-precision operators by enabling INFO log and then searching reduce precision.

Environment Requirements

  • HardwareAscend/GPU/CPU
    • Prepare hardware environment with Ascend、GPU or CPU processor.
  • Framework
  • For more information, please check the resources below

Script description

Script and sample code

├── ReNAS
  ├── Readme.md     # descriptions about adversarial-pruning   # shell script for evaluation with CPU, GPU or Ascend
  ├── src
     ├──loss.py      # parameter configuration
     ├──dataset.py     # creating dataset
     ├──nasnet.py      # Pruned ResNet architecture
  ├── eval.py       # evaluation script

Training process

To Be Done

Eval process

Usage

After installing MindSpore via the official website, you can start evaluation as follows:

Launch

# infer example

  Ascend: python eval.py --dataset_path path/to/cifar10 --platform Ascend --checkpoint_path [CHECKPOINT_PATH]
  GPU: python eval.py --dataset_path path/to/cifar10 --platform GPU --checkpoint_path [CHECKPOINT_PATH]
  CPU: python eval.py --dataset_path path/to/cifar10 --platform CPU --checkpoint_path [CHECKPOINT_PATH]

checkpoint can be produced in training process.

Result

result: {'acc': 0.9411057692307693} ckpt= ./resnet50-imgnet-0.65x-80.24.ckpt

Model Description

Performance

Evaluation Performance

NASBench101-Net on CIFAR-10

Parameters
Model Version NASBench101-Net
uploaded Date 03/27/2021 (month/day/year)
MindSpore Version 0.6.0-alpha
Dataset CIFAR-10
Parameters (M) 4.44
FLOPs (G) 1.9
Accuracy (Top1) 94.11

Description of Random Situation

In dataset.py, we set the seed inside “create_dataset" function. We also use random seed in train.py.

ModelZoo Homepage

Please check the official homepage.