This repository is an official code implementation of FGP, a flow-based generative pre-training method for neural architecture encoding.
- Title: Learning to Flow from Generative Pretext Tasks for Neural Architecture Encoding.
- Authors: Sunwoo Kim, Hyunjin Hwang, Kijung Shin
- Venue: NeurIPS 2025
We use three datasets: NAS-Bench-101 [1], NAS-Bench-201 [2], and NAS-Bench-301 [3].
In the following link, we provide our pre-processed version of these datasets. https://drive.google.com/drive/folders/163H_FbKeeng0rWVtKHiYiEY05qdK6GQX?usp=sharing
- Please make the folder named
./datasetin the same hierarchy withmain.py - Then, please put the datasets in
./datasetfolder.
Refer to the following notebook:
obtaining_flow_surrogate.ipynb
One can reproduce the performance prediction results by running the following code:
python3 main.py -dname nb101 -device cuda:0 -train_ratio 0.01 -proj_layer 2 -proj_dim1 128 -proj_dim2 64 -ssl_lr 0.001 -wdecay 1e-6 -lamda1 0.5 -lamda2 0.5 -enc gatedgcn
Best hyperparameter configurations are in fgp_hyperparameters.pickle.
Each argument corresponds to each hyperparameter, which is as follows:
-
-dnameis astrthat indicates the data name, which should be one of {nb101, nb201, nb301}. -
-deviceis astrthat indicates the data type that indicates GPU device number, such ascuda:0. -
train_ratiois afloatthat indicates the ratio of the training set to be used for model fine-tuning, which should be within$(0,1]$ , such as0.01. -
proj_layeris aintthat indicates the number of layers of the projection head, such as2. -
proj_dim1is aintthat indicates the hidden dimension of the surrogate projection head, such as128. -
proj_dim2is aintthat indicates the hidden dimension of the zero-cost proxy projection head, such as64. -
ssl_lris afloatthat indicates the pre-training learning rate, such as1e-3. -
wdecayis afloatthat indicates the pre-training weight decay, such as1e-6. -
lamda1is afloatthat indicates the loss coefficient of the surrogate reconstruction loss, such as0.5. -
lamda2is afloatthat indicates the loss coefficient of the zero-cost proxy prediction loss, such as0.5. -
encis astrthat indicates the neural architecture encoder type, which should be one of {gatedgcn, gin, flowerformer}.
- Supervised training code is from (Hwang et al., FlowerFormer: Empowering Neural Architecture Encoding using a Flow-aware Graph Transformer, In CVPR 2024).
- [1] Ying et al., NAS-Bench-101: Towards Reproducible Neural Architecture Search, In ICML 2019.
- [2] Dong et al., NAS-Bench-201: Extending the Scope of Reproducible Neural Architecture Search, In ICLR 2020.
- [3] Zela et al., Surrogate NAS Benchmarks: Going Beyond the Limited Search Spaces of Tabular NAS Benchmarks, In ICLR 2022.