Repository navigation
Expand file tree
/
Copy pathfigures.py
More file actions
executable file
·69 lines (56 loc) · 2.88 KB
/
Copy pathfigures.py
File metadata and controls
executable file
·69 lines (56 loc) · 2.88 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
66
67
68
69
import argparse
import subprocess
from data import ORDERED as DATASETS, PAIR
def _draft(fig):
return [["python", "-m", "plot.paper_figures", "--fig", fig]]
FIGURES = {
"landscape": ("Fig. 1 ground truth and predicted surfaces, all targets", _draft("landscape")),
"order_param": ("Fig. 2 derived nonanalytic quantity", _draft("order_param")),
"bounds_vs_n": ("Fig. 3 transfer coefficient vs training-set size", _draft("bounds_vs_n")),
"distance": ("Fig. 4 transfer coefficient vs distance to Tc", _draft("distance")),
"convergence": ("Fig. 5 Monte Carlo convergence of the GEVP bound", _draft("convergence")),
"gp_vs_rff": ("Fig. 6 RFF as a finite proxy for the GP", _draft("gp_vs_rff")),
"gp_variance": ("Fig. 7 GP posterior variance vs realized error", _draft("gp_variance")),
"budget": ("Fig. 8 labeled-budget estimate of MSE_Q", _draft("budget")),
"landau": ("Fig. 9 Landau coefficient and order parameter", _draft("landau")),
"neural": ("Fig. 10 neural architecture landscapes", _draft("neural")),
"slices": ("Fig. 11 fixed-parameter slices", _draft("slices")),
}
TABLES = {
"metrics": ("Table 1 extrapolation metrics, all targets",
[["python", "-m", "eval.metrics_table", "--dataset", d] for d in DATASETS]),
"metrics_neural": ("Table 3 neural baselines",
[["python", "-m", "eval.metrics_table", "--dataset", d,
"--methods", "neural"] for d in PAIR]),
"hyperparams": ("Tables 4-5 selected hyperparameters",
[["python", "-m", "eval.hyperparam_report"]]),
}
def main():
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
p.add_argument("--figure", default="", help="Comma-separated, or 'all'.")
p.add_argument("--table", default="", help="Comma-separated, or 'all'.")
p.add_argument("--list", action="store_true", help="List figures and tables, then exit.")
a = p.parse_args()
if a.list or (not a.figure and not a.table):
print("figures:")
for k, (d, _) in FIGURES.items():
print(f" {k:15s} {d}")
print("\ntables:")
for k, (d, _) in TABLES.items():
print(f" {k:15s} {d}")
print("\nusage: python figures.py --figure all --table all")
return
cmds = []
for sel, catalog in ((a.figure, FIGURES), (a.table, TABLES)):
if not sel:
continue
for n in (list(catalog) if sel == "all" else sel.split(",")):
cmds += catalog[n][1]
print(f"{len(cmds)} job(s)\n")
for i, c in enumerate(cmds, 1):
print(f"\n[{i}/{len(cmds)}] {' '.join(c)}", flush=True)
subprocess.run(c, check=True)
print("\nDone. Figures in figs/.")
if __name__ == "__main__":
main()