-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy path_cli.py
More file actions
65 lines (45 loc) · 1.56 KB
/
Copy path_cli.py
File metadata and controls
65 lines (45 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
"""DeepHyper command line interface.
It can be used in the shell with:
.. code-block:: console
$ deephyper --help
usage: deephyper [-h] {hps,nas,new-problem,ray-cluster,ray-submit,start-project} ...
DeepHyper command line.
positional arguments:
{hps,nas,new-problem,ray-cluster,ray-submit,start-project}
hps Command line to run hyperparameter search.
nas Command line to run neural architecture search.
new-problem Tool to init an hyper-parameter search package or a neural architecture search problem folder.
start-project Set up a new project folder for DeepHyper benchmarks
optional arguments:
-h, --help show this help message and exit
"""
import argparse
from deephyper.core.cli import _hps, _nas, _new_problem, _start_project
def create_parser():
"""
:meta private:
"""
parser = argparse.ArgumentParser(description="DeepHyper command line.")
subparsers = parser.add_subparsers()
# hyper-parameter search
_hps.add_subparser(subparsers)
# neural architecture search cli
_nas.add_subparser(subparsers)
# new-problem
_new_problem.add_subparser(subparsers)
# start-project
_start_project.add_subparser(subparsers)
return parser
def main():
"""
:meta private:
"""
parser = create_parser()
args = parser.parse_args()
if hasattr(args, "func"):
func = args.func
kwargs = vars(args)
kwargs.pop("func")
func(**kwargs)
else:
parser.print_help()