NASBench101-安装及简单样例使用指南

NASBench101-安装及简单样例使用指南

github地址:https://github.com/google-research/nasbench paper原文地址:https://arxiv.org/abs/1902.09635

1. 什么是NASBench101?

NASBench101用一句话概括就是:涵盖了 423,624个神经网络的性能速查表
其中每个网络都在CIFAR10数据集上训练和评价多次。

1.1 NASBench101中网络的设计

具体而言,所有网络共享相同的网络“骨架(skeleton)”,可以在下图左中看到。 不同模型之间的变化是“模块(module)”,它是连接在任意图样结构中的神经网络操作的集合。

![在这里插入图片描述](https://img-blog.csdnimg.cn/2021032112083236.pn
其中每个模块的设计要求:这里模块用一个有向无环图表示(如上图右上角的Inception-like模块),图中最多包含9个顶点和7条边。顶点指有效操作,包含:33卷积,11卷积,3*3的最大池化。

1.2 NASBench101中指标

  • training accuracy
  • validation accuracy
  • testing accuracy
  • number of parameters
  • training time

2. NASBench101的安装

2.1 安装环境

我是在Ubuntu20.04上安装的,所以下面图中的界面都是基于Ubuntu的显示。在windows上的操作大同小异。

从github上clone该项目

git clone https://github.com/google-research/nasbench

若速度过慢,可尝试以下语句

git clone https://github.com.cnpmjs.org/google-research/nasbench

进入该项目文件夹

cd nasbench

安装(若当前环境中无tensorflow cpu版本,该步会安装Tensorflow)

pip install -e .

2.2 下载nasbench数据集

只有下载了该数据集后,才能进行查询。
官方提供了2种数据集。

  1. 有4种epochs训练的结果 (1.95 GB)
    下载链接: https://storage.googleapis.com/nasbench/nasbench_full.tfrecord
  2. 只有训练108 epochs的结果 (499G)
    下载链接:https://storage.googleapis.com/nasbench/nasbench_only108.tfrecord

3. NASBench101的简单样例

(以nasbench_full.tfrecord为例)
在pycharm IDE中打开刚刚git clone的nasbench项目

将2.2中下载的nasbench_full.tfrecord文件放置于该文件夹内

打开example.py文件

根据需求安装absl库,pip install absl-py

运行example.py文件

【注】该过程需要加载nasbench_full.tfrecord数据集,会等待一段时间(我用了124秒)

然后就可以的得到example.py中示例的网络(以邻接矩阵表示)的各项性能指标了。

结果如下图所示。

example.py中示例的网络:
在这里插入图片描述运行结果截图:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

友情提示

如果使用了该数据集,请引用

@InProceedings{pmlr-v97-ying19a,
    title =     {{NAS}-Bench-101: Towards Reproducible Neural Architecture Search},
    author =    {Ying, Chris and Klein, Aaron and Christiansen, Eric and Real, Esteban and Murphy, Kevin and Hutter, Frank},
    booktitle = {Proceedings of the 36th International Conference on Machine Learning},
    pages =     {7105--7114},
    year =      {2019},
    editor =    {Chaudhuri, Kamalika and Salakhutdinov, Ruslan},
    volume =    {97},
    series =    {Proceedings of Machine Learning Research},
    address =   {Long Beach, California, USA},
    month =     {09--15 Jun},
    publisher = {PMLR},
    url =       {http://proceedings.mlr.press/v97/ying19a.html},
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值