-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap_NADE.py
More file actions
29 lines (26 loc) · 1.28 KB
/
bootstrap_NADE.py
File metadata and controls
29 lines (26 loc) · 1.28 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
import argparse
import numpy as np
from utils.evaluation import bootstrap
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-a', '--AV', type=int, choices=[0, 1, 2],
default=0, help='The AV model under test')
parser.add_argument('-b', '--num_bootstrap', type=int,
default=1000, help='Number of bootstrap')
parser.add_argument('-s', '--num_separation', type=int,
default=100, help='Number of separation')
parser.add_argument('-t', '--RHW_threshold', type=float,
default=0.3, help='The threshold for relative half-width')
args = parser.parse_args()
AV = args.AV
num_bootstrap = args.num_bootstrap
num_separation = args.num_separation
RHW_threshold = args.RHW_threshold
print(f'Bootstrapping NADE, AV = {AV}, num_bootstrap = {num_bootstrap}')
crash_NADE = np.load(f'results/crash_NADE_AV_{AV}.npy').flatten()
# required number of tests (RNoT)
RNoT_NADE = bootstrap(crash_NADE,
n_bootstrap=num_bootstrap,
sep=num_separation,
RHW_threshold=RHW_threshold)
np.save(f'results/RNoT_NADE_bootstrap_{num_bootstrap}_AV_{AV}', RNoT_NADE)