Fix NATS-Bench and NAS-Bench-201 for removing lib
This commit is contained in:
@@ -12,15 +12,12 @@ from copy import deepcopy
|
||||
from pathlib import Path
|
||||
import torch
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
from config_utils import load_config
|
||||
from datasets import get_datasets, SearchDataset
|
||||
from procedures import prepare_seed, prepare_logger
|
||||
from log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from xautodl.config_utils import load_config
|
||||
from xautodl.datasets import get_datasets, SearchDataset
|
||||
from xautodl.procedures import prepare_seed, prepare_logger
|
||||
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from xautodl.models import CellStructure, get_search_spaces
|
||||
from nas_201_api import NASBench201API as API
|
||||
from models import CellStructure, get_search_spaces
|
||||
|
||||
# BOHB: Robust and Efficient Hyperparameter Optimization at Scale, ICML 2018
|
||||
import ConfigSpace
|
||||
|
@@ -8,21 +8,18 @@ from copy import deepcopy
|
||||
import torch
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
from config_utils import load_config, dict2config, configure2str
|
||||
from datasets import get_datasets, get_nas_search_loaders
|
||||
from procedures import (
|
||||
from xautodl.config_utils import load_config, dict2config, configure2str
|
||||
from xautodl.datasets import get_datasets, get_nas_search_loaders
|
||||
from xautodl.procedures import (
|
||||
prepare_seed,
|
||||
prepare_logger,
|
||||
save_checkpoint,
|
||||
copy_checkpoint,
|
||||
get_optim_scheduler,
|
||||
)
|
||||
from utils import get_model_infos, obtain_accuracy
|
||||
from log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from models import get_cell_based_tiny_net, get_search_spaces
|
||||
from xautodl.utils import get_model_infos, obtain_accuracy
|
||||
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from xautodl.models import get_cell_based_tiny_net, get_search_spaces
|
||||
from nas_201_api import NASBench201API as API
|
||||
|
||||
|
||||
|
@@ -8,23 +8,19 @@ import numpy as np
|
||||
from copy import deepcopy
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
from config_utils import load_config, dict2config, configure2str
|
||||
from datasets import get_datasets, get_nas_search_loaders
|
||||
from procedures import (
|
||||
from xautodl.config_utils import load_config, dict2config, configure2str
|
||||
from xautodl.datasets import get_datasets, get_nas_search_loaders
|
||||
from xautodl.procedures import (
|
||||
prepare_seed,
|
||||
prepare_logger,
|
||||
save_checkpoint,
|
||||
copy_checkpoint,
|
||||
get_optim_scheduler,
|
||||
)
|
||||
from utils import get_model_infos, obtain_accuracy
|
||||
from log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from models import get_cell_based_tiny_net, get_search_spaces
|
||||
from xautodl.utils import get_model_infos, obtain_accuracy
|
||||
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from xautodl.models import get_cell_based_tiny_net, get_search_spaces
|
||||
from nas_201_api import NASBench201API as API
|
||||
|
||||
|
||||
@@ -443,7 +439,7 @@ def main(xargs):
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser("DARTS Second Order")
|
||||
parser.add_argument("--data_path", type=str, help="Path to dataset")
|
||||
parser.add_argument("--data_path", type=str, help="The path to dataset")
|
||||
parser.add_argument(
|
||||
"--dataset",
|
||||
type=str,
|
||||
|
@@ -8,23 +8,19 @@ import numpy as np
|
||||
from copy import deepcopy
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
from config_utils import load_config, dict2config, configure2str
|
||||
from datasets import get_datasets, get_nas_search_loaders
|
||||
from procedures import (
|
||||
from xautodl.config_utils import load_config, dict2config, configure2str
|
||||
from xautodl.datasets import get_datasets, get_nas_search_loaders
|
||||
from xautodl.procedures import (
|
||||
prepare_seed,
|
||||
prepare_logger,
|
||||
save_checkpoint,
|
||||
copy_checkpoint,
|
||||
get_optim_scheduler,
|
||||
)
|
||||
from utils import get_model_infos, obtain_accuracy
|
||||
from log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from models import get_cell_based_tiny_net, get_search_spaces
|
||||
from xautodl.utils import get_model_infos, obtain_accuracy
|
||||
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from xautodl.models import get_cell_based_tiny_net, get_search_spaces
|
||||
from nas_201_api import NASBench201API as API
|
||||
|
||||
|
||||
@@ -527,7 +523,7 @@ def main(xargs):
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser("ENAS")
|
||||
parser.add_argument("--data_path", type=str, help="Path to dataset")
|
||||
parser.add_argument("--data_path", type=str, help="The path to dataset")
|
||||
parser.add_argument(
|
||||
"--dataset",
|
||||
type=str,
|
||||
|
@@ -6,23 +6,18 @@
|
||||
import sys, time, random, argparse
|
||||
from copy import deepcopy
|
||||
import torch
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
from config_utils import load_config, dict2config
|
||||
from datasets import get_datasets, get_nas_search_loaders
|
||||
from procedures import (
|
||||
from xautodl.config_utils import load_config, dict2config
|
||||
from xautodl.datasets import get_datasets, get_nas_search_loaders
|
||||
from xautodl.procedures import (
|
||||
prepare_seed,
|
||||
prepare_logger,
|
||||
save_checkpoint,
|
||||
copy_checkpoint,
|
||||
get_optim_scheduler,
|
||||
)
|
||||
from utils import get_model_infos, obtain_accuracy
|
||||
from log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from models import get_cell_based_tiny_net, get_search_spaces
|
||||
from xautodl.utils import get_model_infos, obtain_accuracy
|
||||
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from xautodl.models import get_cell_based_tiny_net, get_search_spaces
|
||||
from nas_201_api import NASBench201API as API
|
||||
|
||||
|
||||
@@ -343,7 +338,7 @@ def main(xargs):
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser("GDAS")
|
||||
parser.add_argument("--data_path", type=str, help="Path to dataset")
|
||||
parser.add_argument("--data_path", type=str, help="The path to dataset")
|
||||
parser.add_argument(
|
||||
"--dataset",
|
||||
type=str,
|
||||
|
@@ -8,23 +8,19 @@ import numpy as np
|
||||
from copy import deepcopy
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
from config_utils import load_config, dict2config, configure2str
|
||||
from datasets import get_datasets, get_nas_search_loaders
|
||||
from procedures import (
|
||||
from xautodl.config_utils import load_config, dict2config, configure2str
|
||||
from xautodl.datasets import get_datasets, get_nas_search_loaders
|
||||
from xautodl.procedures import (
|
||||
prepare_seed,
|
||||
prepare_logger,
|
||||
save_checkpoint,
|
||||
copy_checkpoint,
|
||||
get_optim_scheduler,
|
||||
)
|
||||
from utils import get_model_infos, obtain_accuracy
|
||||
from log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from models import get_cell_based_tiny_net, get_search_spaces
|
||||
from xautodl.utils import get_model_infos, obtain_accuracy
|
||||
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from xautodl.models import get_cell_based_tiny_net, get_search_spaces
|
||||
from nas_201_api import NASBench201API as API
|
||||
|
||||
|
||||
@@ -335,7 +331,7 @@ def main(xargs):
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser("Random search for NAS.")
|
||||
parser.add_argument("--data_path", type=str, help="Path to dataset")
|
||||
parser.add_argument("--data_path", type=str, help="The path to dataset")
|
||||
parser.add_argument(
|
||||
"--dataset",
|
||||
type=str,
|
||||
|
@@ -8,21 +8,19 @@ import torch
|
||||
import torch.nn as nn
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
from config_utils import load_config, dict2config, configure2str
|
||||
from datasets import get_datasets, SearchDataset
|
||||
from procedures import (
|
||||
from xautodl.config_utils import load_config, dict2config, configure2str
|
||||
from xautodl.datasets import get_datasets, SearchDataset
|
||||
from xautodl.procedures import (
|
||||
prepare_seed,
|
||||
prepare_logger,
|
||||
save_checkpoint,
|
||||
copy_checkpoint,
|
||||
get_optim_scheduler,
|
||||
)
|
||||
from utils import get_model_infos, obtain_accuracy
|
||||
from log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from models import get_search_spaces
|
||||
from xautodl.utils import get_model_infos, obtain_accuracy
|
||||
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from xautodl.models import get_search_spaces
|
||||
|
||||
from nas_201_api import NASBench201API as API
|
||||
from R_EA import train_and_eval, random_architecture_func
|
||||
|
||||
|
@@ -3,3 +3,5 @@
|
||||
The Python files in this folder are used to re-produce the results in our NAS-Bench-201 paper.
|
||||
|
||||
We have upgraded the codes to be more general and extendable at [NATS-algos](https://github.com/D-X-Y/AutoDL-Projects/tree/main/exps/NATS-algos).
|
||||
|
||||
**Notice** On 24 May 2021, the codes in `AutoDL` repo have been re-organized. If you find `module not found` error, please let me know. I will fix them ASAP.
|
||||
|
@@ -10,22 +10,19 @@ import torch
|
||||
import torch.nn as nn
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
from config_utils import load_config, dict2config, configure2str
|
||||
from datasets import get_datasets, SearchDataset
|
||||
from procedures import (
|
||||
from xautodl.config_utils import load_config, dict2config, configure2str
|
||||
from xautodl.datasets import get_datasets, SearchDataset
|
||||
from xautodl.procedures import (
|
||||
prepare_seed,
|
||||
prepare_logger,
|
||||
save_checkpoint,
|
||||
copy_checkpoint,
|
||||
get_optim_scheduler,
|
||||
)
|
||||
from utils import get_model_infos, obtain_accuracy
|
||||
from log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from xautodl.utils import get_model_infos, obtain_accuracy
|
||||
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from xautodl.models import CellStructure, get_search_spaces
|
||||
from nas_201_api import NASBench201API as API
|
||||
from models import CellStructure, get_search_spaces
|
||||
|
||||
|
||||
class Model(object):
|
||||
|
@@ -10,21 +10,18 @@ import torch
|
||||
import torch.nn as nn
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
from config_utils import load_config, dict2config, configure2str
|
||||
from datasets import get_datasets, get_nas_search_loaders
|
||||
from procedures import (
|
||||
from xautodl.config_utils import load_config, dict2config, configure2str
|
||||
from xautodl.datasets import get_datasets, get_nas_search_loaders
|
||||
from xautodl.procedures import (
|
||||
prepare_seed,
|
||||
prepare_logger,
|
||||
save_checkpoint,
|
||||
copy_checkpoint,
|
||||
get_optim_scheduler,
|
||||
)
|
||||
from utils import get_model_infos, obtain_accuracy
|
||||
from log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from models import get_cell_based_tiny_net, get_search_spaces
|
||||
from xautodl.utils import get_model_infos, obtain_accuracy
|
||||
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from xautodl.models import get_cell_based_tiny_net, get_search_spaces
|
||||
from nas_201_api import NASBench201API as API
|
||||
|
||||
|
||||
|
@@ -11,22 +11,19 @@ import torch
|
||||
import torch.nn as nn
|
||||
from torch.distributions import Categorical
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
from config_utils import load_config, dict2config, configure2str
|
||||
from datasets import get_datasets, SearchDataset
|
||||
from procedures import (
|
||||
from xautodl.config_utils import load_config, dict2config, configure2str
|
||||
from xautodl.datasets import get_datasets, SearchDataset
|
||||
from xautodl.procedures import (
|
||||
prepare_seed,
|
||||
prepare_logger,
|
||||
save_checkpoint,
|
||||
copy_checkpoint,
|
||||
get_optim_scheduler,
|
||||
)
|
||||
from utils import get_model_infos, obtain_accuracy
|
||||
from log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from xautodl.utils import get_model_infos, obtain_accuracy
|
||||
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
|
||||
from xautodl.models import CellStructure, get_search_spaces
|
||||
from nas_201_api import NASBench201API as API
|
||||
from models import CellStructure, get_search_spaces
|
||||
from R_EA import train_and_eval
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user