-
Notifications
You must be signed in to change notification settings - Fork 5
/
run.py
66 lines (53 loc) · 1.56 KB
/
run.py
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
try:
import matplotlib as mpl
# mpl.use('Qt4Agg')
mpl.use('Agg')
can_plot = True
except ImportError:
can_plot = False
from hrr_scaling.tools import parse_args
from hrr_scaling.main import run
argvals = parse_args(True)
# specify tests
n_runs = argvals.runs
jump_trials = argvals.jump
hier_trials = argvals.hier
sent_trials = argvals.sent
deep_trials = argvals.deep
expr = argvals.expr
unitary_roles = argvals.unitary_roles
short_sentence = argvals.short_sent
do_neg = not argvals.no_neg
# seeds
corpus_seed = argvals.corpus_seed
extractor_seed = argvals.extractor_seed
test_seed = argvals.test_seed
seed = argvals.seed
# corpus args
dimension = argvals.d
n_synsets = argvals.num_synsets
proportion = argvals.p
unitary_relations = argvals.unitary_relations
id_vecs = not argvals.no_ids
sp_noise = argvals.sp_noise
normalize = not argvals.no_norm
# extractor args
abstract = argvals.abstract
synapse = argvals.synapse
timesteps = argvals.steps
threshold = argvals.threshold
probe_all = argvals.probe_all
fast = argvals.fast
plot = not argvals.no_plot and can_plot and not abstract
gpu = argvals.gpu
use_gpus = argvals.use_gpus
if gpu and not use_gpus:
use_gpus = [0]
identical = bool(use_gpus)
name = argvals.name
run(n_runs, jump_trials, hier_trials, sent_trials, deep_trials, expr,
unitary_roles, short_sentence, do_neg, corpus_seed,
extractor_seed, test_seed, seed, dimension, n_synsets,
proportion, unitary_relations, id_vecs, sp_noise, normalize,
abstract, synapse, timesteps, threshold, probe_all, identical, fast,
plot, use_gpus, name)