From 28d354880c1ed485b3c0b1552e4868e2e69a3797 Mon Sep 17 00:00:00 2001 From: D-X-Y <280835372@qq.com> Date: Sat, 18 Jan 2020 21:54:17 +1100 Subject: [PATCH] update GDAS --- docs/CVPR-2019-GDAS.md | 2 ++ exps-tf/GDAS.py | 5 +++++ lib/tf_models/cell_searchs/search_cells.py | 4 ++-- lib/tf_models/cell_searchs/search_model_gdas.py | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/CVPR-2019-GDAS.md b/docs/CVPR-2019-GDAS.md index a183d3b..4e276cf 100644 --- a/docs/CVPR-2019-GDAS.md +++ b/docs/CVPR-2019-GDAS.md @@ -62,6 +62,8 @@ CUDA_VISIBLE_DEVICES=0 bash ./scripts-search/NAS-Bench-201/train-a-net.sh '|nor_ `|nor_conv_3x3~0|+|nor_conv_3x3~0|nor_conv_3x3~1|+|skip_connect~0|skip_connect~1|skip_connect~2|` represents the structure of a searched architecture. My codes will automatically print it during the searching procedure. +**Tensorflow codes for GDAS are in experimental state**, which locates at `exps-tf`. + # Citation If you find that this project helps your research, please consider citing the following paper: diff --git a/exps-tf/GDAS.py b/exps-tf/GDAS.py index ff7bea9..a77511e 100644 --- a/exps-tf/GDAS.py +++ b/exps-tf/GDAS.py @@ -1,4 +1,9 @@ +# [D-X-Y] +# Run GDAS # CUDA_VISIBLE_DEVICES=0 python exps-tf/GDAS.py +# Run DARTS +# CUDA_VISIBLE_DEVICES=0 python exps-tf/GDAS.py --tau_max -1 --tau_min -1 --epochs 50 +# import os, sys, math, time, random, argparse import tensorflow as tf from pathlib import Path diff --git a/lib/tf_models/cell_searchs/search_cells.py b/lib/tf_models/cell_searchs/search_cells.py index e93c84a..83de6b3 100644 --- a/lib/tf_models/cell_searchs/search_cells.py +++ b/lib/tf_models/cell_searchs/search_cells.py @@ -7,10 +7,10 @@ from copy import deepcopy from ..cell_operations import OPS -class SearchCell(tf.keras.layers.Layer): +class NAS201SearchCell(tf.keras.layers.Layer): def __init__(self, C_in, C_out, stride, max_nodes, op_names, affine=False): - super(SearchCell, self).__init__() + super(NAS201SearchCell, self).__init__() self.op_names = deepcopy(op_names) self.max_nodes = max_nodes diff --git a/lib/tf_models/cell_searchs/search_model_gdas.py b/lib/tf_models/cell_searchs/search_model_gdas.py index 1df26a6..d10bb19 100644 --- a/lib/tf_models/cell_searchs/search_model_gdas.py +++ b/lib/tf_models/cell_searchs/search_model_gdas.py @@ -5,7 +5,7 @@ import tensorflow as tf import numpy as np from copy import deepcopy from ..cell_operations import ResNetBasicblock -from .search_cells import SearchCell +from .search_cells import NAS201SearchCell as SearchCell def sample_gumbel(shape, eps=1e-20):